@@ -47,8 +47,7 @@ Unsupported idioms / known issues
47
47
- nose imports test modules with the same import path (e.g.
48
48
``tests.test_mode ``) but different file system paths
49
49
(e.g. ``tests/test_mode.py `` and ``other/tests/test_mode.py ``)
50
- by extending sys.path/import semantics. pytest does not do that
51
- but there is discussion in :issue: `268 ` for adding some support. Note that
50
+ by extending sys.path/import semantics. pytest does not do that. Note that
52
51
`nose2 choose to avoid this sys.path/import hackery <https://nose2.readthedocs.io/en/latest/differences.html#test-discovery-and-loading >`_.
53
52
54
53
If you place a conftest.py file in the root directory of your project
@@ -66,16 +65,34 @@ Unsupported idioms / known issues
66
65
67
66
- no nose-configuration is recognized.
68
67
69
- - ``yield ``-based methods are unsupported as of pytest 4.1.0. They are
68
+ - ``yield ``-based methods are
70
69
fundamentally incompatible with pytest because they don't support fixtures
71
70
properly since collection and test execution are separated.
72
71
72
+ Here is a table comparing the default supported naming conventions for both
73
+ nose and pytest.
74
+
75
+ ========= ========================== ======= =====
76
+ what default naming convention pytest nose
77
+ ========= ========================== ======= =====
78
+ module ``test*.py `` ✅
79
+ module ``test_*.py `` ✅ ✅
80
+ module ``*_test.py `` ✅
81
+ module ``*_tests.py ``
82
+ class ``*(unittest.TestCase) `` ✅ ✅
83
+ method ``test_* `` ✅ ✅
84
+ class ``Test* `` ✅
85
+ method ``test_* `` ✅
86
+ function ``test_* `` ✅
87
+ ========= ========================== ======= =====
88
+
89
+
73
90
Migrating from nose to pytest
74
91
------------------------------
75
92
76
93
`nose2pytest <https://github.com/pytest-dev/nose2pytest >`_ is a Python script
77
94
and pytest plugin to help convert Nose-based tests into pytest-based tests.
78
- Specifically, the script transforms nose.tools.assert_* function calls into
95
+ Specifically, the script transforms `` nose.tools.assert_* `` function calls into
79
96
raw assert statements, while preserving format of original arguments
80
97
as much as possible.
81
98
0 commit comments