[PATCH 01 of 11 logilab-common] [tox] move to pytest

Laurent Peuch cortex at worlddomination.be
Wed Apr 1 16:20:02 CEST 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1584710288 -3600
#      Fri Mar 20 14:18:08 2020 +0100
# Node ID cb323a77d85c24db76404540999f31ed331358e2
# Parent  86cca2c6a40f31988cc42fa9cd0b4cb15d298613
# Available At https://hg.logilab.org/users/lpeuch/logilab-common
#              hg pull https://hg.logilab.org/users/lpeuch/logilab-common -r cb323a77d85c
# EXP-Topic types-annotations-and-cleaning
[tox] move to pytest

diff --git a/test/unittest_cache.py b/test/test_cache.py
rename from test/unittest_cache.py
rename to test/test_cache.py
diff --git a/test/unittest_changelog.py b/test/test_changelog.py
rename from test/unittest_changelog.py
rename to test/test_changelog.py
diff --git a/test/unittest_configuration.py b/test/test_configuration.py
rename from test/unittest_configuration.py
rename to test/test_configuration.py
diff --git a/test/unittest_date.py b/test/test_date.py
rename from test/unittest_date.py
rename to test/test_date.py
diff --git a/test/unittest_decorators.py b/test/test_decorators.py
rename from test/unittest_decorators.py
rename to test/test_decorators.py
diff --git a/test/unittest_deprecation.py b/test/test_deprecation.py
rename from test/unittest_deprecation.py
rename to test/test_deprecation.py
diff --git a/test/unittest_fileutils.py b/test/test_fileutils.py
rename from test/unittest_fileutils.py
rename to test/test_fileutils.py
diff --git a/test/unittest_graph.py b/test/test_graph.py
rename from test/unittest_graph.py
rename to test/test_graph.py
diff --git a/test/unittest_interface.py b/test/test_interface.py
rename from test/unittest_interface.py
rename to test/test_interface.py
diff --git a/test/unittest_modutils.py b/test/test_modutils.py
rename from test/unittest_modutils.py
rename to test/test_modutils.py
diff --git a/test/unittest_pytest.py b/test/test_pytest.py
rename from test/unittest_pytest.py
rename to test/test_pytest.py
diff --git a/test/unittest_registry.py b/test/test_registry.py
rename from test/unittest_registry.py
rename to test/test_registry.py
--- a/test/unittest_registry.py
+++ b/test/test_registry.py
@@ -202,18 +202,18 @@ class RegistrableInstanceTC(TestCase):
     def test_instance_modulename(self):
         with warnings.catch_warnings(record=True) as warns:
             obj = RegistrableInstance()
-            self.assertEqual(obj.__module__, 'unittest_registry')
+            self.assertEqual(obj.__module__, 'test_registry')
             self.assertIn('instantiate RegistrableInstance with __module__=__name__',
                           [str(w.message) for w in warns])
         # no inheritance
         obj = RegistrableInstance(__module__=__name__)
-        self.assertEqual(obj.__module__, 'unittest_registry')
+        self.assertEqual(obj.__module__, 'test_registry')
         # with inheritance from another python file
         with prepended_syspath(self.datadir):
             from regobjects2 import instance, MyRegistrableInstance
             instance2 = MyRegistrableInstance(__module__=__name__)
             self.assertEqual(instance.__module__, 'regobjects2')
-            self.assertEqual(instance2.__module__, 'unittest_registry')
+            self.assertEqual(instance2.__module__, 'test_registry')
 
 
 if __name__ == '__main__':
diff --git a/test/unittest_shellutils.py b/test/test_shellutils.py
rename from test/unittest_shellutils.py
rename to test/test_shellutils.py
diff --git a/test/unittest_table.py b/test/test_table.py
rename from test/unittest_table.py
rename to test/test_table.py
diff --git a/test/unittest_taskqueue.py b/test/test_taskqueue.py
rename from test/unittest_taskqueue.py
rename to test/test_taskqueue.py
diff --git a/test/unittest_testlib.py b/test/test_testlib.py
rename from test/unittest_testlib.py
rename to test/test_testlib.py
diff --git a/test/unittest_textutils.py b/test/test_textutils.py
rename from test/unittest_textutils.py
rename to test/test_textutils.py
diff --git a/test/unittest_tree.py b/test/test_tree.py
rename from test/unittest_tree.py
rename to test/test_tree.py
diff --git a/test/unittest_umessage.py b/test/test_umessage.py
rename from test/unittest_umessage.py
rename to test/test_umessage.py
diff --git a/test/unittest_ureports_html.py b/test/test_ureports_html.py
rename from test/unittest_ureports_html.py
rename to test/test_ureports_html.py
diff --git a/test/unittest_ureports_text.py b/test/test_ureports_text.py
rename from test/unittest_ureports_text.py
rename to test/test_ureports_text.py
diff --git a/test/unittest_xmlutils.py b/test/test_xmlutils.py
rename from test/unittest_xmlutils.py
rename to test/test_xmlutils.py
diff --git a/tox.ini b/tox.ini
--- a/tox.ini
+++ b/tox.ini
@@ -4,8 +4,9 @@ envlist=py3
 [testenv]
 deps =
   pytz
+  pytest
 commands=
-  logilab-pytest -t test {posargs}
+  {envpython} -m pytest test {posargs}
 
 [testenv:docs]
 basepython = python2




More information about the cubicweb-devel mailing list