diff --git a/tests/test_nginx_vhosts.py b/tests/test_nginx_vhosts.py
index cfef9d8db9045c83d99789d3baa0e988d139c39d..bc7599813db8cbe63946759ddaeec9b4cd2e7373 100755
--- a/tests/test_nginx_vhosts.py
+++ b/tests/test_nginx_vhosts.py
@@ -49,7 +49,7 @@ if os.path.exists('/etc/celerity/config.py'):
 resolution_ignored = conf.get('TESTER_VHOST_RESOLUTION_IGNORED', '').split(',')
 found = False
 errors = 0
-warnings = False
+warnings = 0
 for name in os.listdir(nginx_dir):
     path = os.path.join(nginx_dir, name)
     with open(path, 'r') as fo:
@@ -71,7 +71,7 @@ for name in os.listdir(nginx_dir):
         sys.stdout.write('Testing url "%s":\n' % url)
         if name.startswith('mediaserver') and url not in celerity_conf:
             sys.stdout.write('Url "%s" not found in celerity conf; it should also be set in the MediaWorker.\n' % url)
-            warnings = True
+            warnings += 1
         # test domain IP
         ip_error = None
         ip_warning = None
@@ -128,7 +128,7 @@ for name in os.listdir(nginx_dir):
         sys.stdout.write('.\n')
 
         if ip_warning:
-            warnings +=1
+            warnings += 1
 
         if ip_error or req_error:
             errors += 1