{"id":4713,"library":"pynose","title":"PyNose","description":"PyNose is an updated version of the `nose` testing framework, designed to extend `unittest` and simplify Python testing. It aims to fix compatibility issues with newer Python versions and improve upon the original `nose` project. As of version 1.5.5, it supports Python 3.7+ (including 3.14+). It has an active release cadence, with several updates addressing compatibility and adding features recently.","status":"active","version":"1.5.5","language":"en","source_language":"en","source_url":"https://github.com/mdmintz/pynose","tags":["testing","unittest","nose","test runner","test discovery"],"install":[{"cmd":"pip install pynose","lang":"bash","label":"Install PyNose"}],"dependencies":[],"imports":[{"note":"When `pynose` is installed, it occupies the `nose` namespace, making `import nose` refer to PyNose's functionality. The primary usage is typically via the `pynose` or `nosetests` command-line executables.","symbol":"nose.main","correct":"import nose\n# Then call nose.main() or nose.run()"}],"quickstart":{"code":"# test_example.py\nimport unittest\n\nclass MyTestCase(unittest.TestCase):\n    def test_addition(self):\n        self.assertEqual(1 + 1, 2)\n\n    def test_subtraction(self):\n        self.assertEqual(2 - 1, 1)\n\ndef test_simple_function():\n    assert True\n\n# To run these tests from the command line, save this file\n# and then execute 'pynose' or 'nosetests' in your terminal.\n# Example: pynose test_example.py\n","lang":"python","description":"Create a test file (e.g., `test_example.py`). PyNose automatically discovers tests in files or directories whose names include 'test' or 'Test'. You can run tests using the `pynose` or `nosetests` command from your terminal."},"warnings":[{"fix":"Upgrade Python to 3.7 or newer, or pin PyNose to a version < 1.5.0.","message":"PyNose v1.5.0 dropped official support for Python 3.6. Users on Python 3.6 or older must upgrade their Python environment to at least 3.7 or use an older version of PyNose.","severity":"breaking","affected_versions":">=1.5.0"},{"fix":"If `print()` output is undesired, use `pynose --capture-output` or `nosetests --capture-output`. If `print()` output is missing in older versions, use `pynose -s`.","message":"Unlike legacy `nose` which captured `stdout` by default (hiding `print()` output), PyNose (from v1.4.8 onwards) makes `print()` output visible by default (equivalent to `nose -s`). To suppress `print()` output, use the `--capture-output` command-line option.","severity":"gotcha","affected_versions":">=1.4.8"},{"fix":"Ensure test files conform to `nose`-style testing or adjust your test runner to `pytest` if `pytest` fixtures are predominantly used.","message":"PyNose automatically skips tests that utilize `pytest` fixtures. This can lead to tests not being run as expected if a project mixes `nose`-style tests with `pytest` fixture-based tests.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consolidate your test paths or adjust your test discovery strategy to use a single `-w` argument if possible, or rely on automatic discovery from the current working directory.","message":"The use of multiple `-w` arguments to specify working directories for test discovery is deprecated and will be removed in a future release.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Test your migrated suite thoroughly. Consult the PyNose GitHub page for details on specific fixes and changes compared to the original `nose`.","message":"PyNose is a modern replacement for the abandoned `nose` project. While largely a drop-in, projects migrating directly from original `nose` might encounter subtle differences in behavior or unsupported `nose` idioms (e.g., specific `sys.path` manipulations, certain `nose`-style doctests, or `yield`-based methods) that were part of the legacy implementation.","severity":"gotcha","affected_versions":"All versions (when migrating from legacy `nose`)"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}