diff --git a/test/test_speed.py b/test/test_speed.py
index e32f34be04dc4511879ec63755314627caa9f1f6..4a473bef62223e3ddad84b40483885e0242c687a 100644
--- a/test/test_speed.py
+++ b/test/test_speed.py
@@ -13,6 +13,7 @@ from mhcflurry.common import random_peptides
 
 DOWNLOADED_PREDICTOR = Class1AffinityPredictor.load()
 
+NUM = 10000
 
 def test_speed(profile=False):
     starts = collections.OrderedDict()
@@ -30,7 +31,6 @@ def test_speed(profile=False):
         if profile:
             profilers[name].disable()
 
-    NUM = 10000
 
     start("first")
     DOWNLOADED_PREDICTOR.predict(["SIINFEKL"], allele="HLA-A*02:01")