فهرست منبع

Switch to pytest (#317)

Nuwan Goonasekera 2 سال پیش
والد
کامیت
bcbdfd586f
3فایلهای تغییر یافته به همراه6 افزوده شده و 17 حذف شده
  1. 0 11
      setup.cfg
  2. 1 2
      setup.py
  3. 5 4
      tox.ini

+ 0 - 11
setup.cfg

@@ -6,17 +6,6 @@ omit =
   cloudbridge/__init__.py
 parallel = True
 
-[nosetests]
-with-coverage=1
-cover-branches=1
-cover-package=cloudbridge
-processes=5
-process-timeout=3000
-match=^[Tt]est
-verbosity=2
-# When exceptions occur, filter only cloudbridge logs
-logging-filter=cloudbridge
-
 [bdist_wheel]
 universal = 1
 

+ 1 - 2
setup.py

@@ -57,7 +57,7 @@ REQS_FULL = REQS_AWS + REQS_GCP + REQS_OPENSTACK + REQS_AZURE
 # httpretty is required with/for moto 1.0.0 or AWS tests fail
 REQS_DEV = ([
     'tox>=2.1.1',
-    'nose',
+    'pytest',
     'moto>=3.1.18',
     'sphinx>=1.3.1',
     'pydevd',
@@ -73,7 +73,6 @@ setup(
     author='Galaxy and GVL Projects',
     author_email='help@genome.edu.au',
     url='http://cloudbridge.cloudve.org/',
-    setup_requires=['nose>=1.0'],
     install_requires=REQS_BASE,
     extras_require={
         ':python_version<"3.3"': ['ipaddress'],

+ 5 - 4
tox.ini

@@ -9,8 +9,8 @@
 envlist = {py3.10,pypy}-{aws,azure,gcp,openstack,mock},lint
 
 [testenv]
-commands = # see setup.cfg for options sent to nosetests and coverage
-           nosetests -v --nocapture --nologcapture --logging-format='%(asctime)s [%(levelname)s] %(name)s: %(message)s' {posargs}
+commands = # see setup.cfg for options sent to pytest and coverage
+           coverage run --source=cloudbridge -m pytest -n 5 tests/ -v {posargs}
 setenv =
     # Fix for moto import issue: https://github.com/travis-ci/travis-ci/issues/7940
     BOTO_CONFIG=/dev/null
@@ -30,8 +30,9 @@ passenv =
     mock: CB_IMAGE_AWS,CB_VM_TYPE_AWS,CB_PLACEMENT_AWS,AWS_ACCESS_KEY,AWS_SECRET_KEY
 deps =
     -rrequirements.txt
-    coverage<5
+    coverage
+    pytest-xdist
 
 [testenv:lint]
 commands = flake8 cloudbridge tests setup.py
-deps = flake8
+deps = flake8