Django test runner using nose

Related tags

Testingdjango-nose
Overview

django-nose

The PyPI package GitHub Actions Coverage Jazzband

django-nose provides all the goodness of nose in your Django tests, like:

  • Testing just your apps by default, not all the standard ones that happen to be in INSTALLED_APPS
  • Running the tests in one or more specific modules (or apps, or classes, or folders, or just running a specific test)
  • Obviating the need to import all your tests into tests/__init__.py. This not only saves busy-work but also eliminates the possibility of accidentally shadowing test classes.
  • Taking advantage of all the useful nose plugins

It also provides:

  • Fixture bundling, an optional feature which speeds up your fixture-based tests by a factor of 4
  • Reuse of previously created test DBs, cutting 10 seconds off startup time
  • Hygienic TransactionTestCases, which can save you a DB flush per test
  • Support for various databases. Tested with MySQL, PostgreSQL, and SQLite. Others should work as well.

django-nose requires nose 1.2.1 or later, and the latest release is recommended. It follows the Django's support policy, supporting:

  • Django 1.8 (LTS) with Python 3.5
  • Django 1.9 with Python 3.5
  • Django 1.10 with Python 3.5
  • Django 1.11 (LTS) with Python 3.5 or 3.6
  • Django 2.0 with Python 3.5, 3.6, or 3.7
  • Django 2.1 with Python 3.5, 3.6, or 3.7
  • Django 2.2 with Python 3.5, 3.6, or 3.7

Note to users

nose has been in maintenance mode since at least 2015. django-nose is in maintenance mode as well, and the sole maintainer is no longer an active user. See Jazzband.co to learn how django-nose is maintained and how you can help. New projects should consider using pytest, or unittest with the Django testing framework.

Installation

You can get django-nose from PyPI with... :

$ pip install django-nose

The development version can be installed with... :

$ pip install -e git://github.com/jazzband/django-nose.git#egg=django-nose

Since django-nose extends Django's built-in test command, you should add it to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = (
    ...
    'django_nose',
    ...
)

Then set TEST_RUNNER in settings.py:

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

Development

Code: https://github.com/jazzband/django-nose
Issues: https://github.com/jazzband/django-nose/issues?state=open
Docs: https://django-nose.readthedocs.io
Comments
  • builds broken for latest django (1.8)

    builds broken for latest django (1.8)

    The trunk builds are broken because of django/[email protected]

    The option parser was changed to argparse, and an optparse compatability layer was introduced. I don't believe the hackety way of "option renaming" can be done as it is right now.

    See: https://github.com/django-nose/django-nose/blob/bfeb0983cce5d78c88a6099057a746c795574fa3/django_nose/runner.py#L102

    opened by conrado 47
  • Merge nose options into Django 1.8 argparse-based options

    Merge nose options into Django 1.8 argparse-based options

    When django.core.management.base.BaseCommand includes 'use_argparse', then nose's optparse options are merged using argparse's parser.add_argument in BaseCommand's overriden add_arguments method.

    For Django 1.7 and earlier, the current .options method is used to set the options.

    Fixes #178. Includes #194, to prove it works on Django 1.8. Replaces #195.

    opened by jwhitlock 14
  • Release 1.4

    Release 1.4

    A 1.4 release is needed for Django 1.8 compatibility.

    Includes PRs

    • #185 - Django 1.8 compatibility
    • #188 - Add contribute.json
    • #187 - Support --testrunner
    • #194 - Add 1.8 to test matrix
    • #196 - Convert nose optparse options to argparse

    Any other PRs that should be included?

    opened by jwhitlock 13
  • parses long options with no equals sign incorrectly

    parses long options with no equals sign incorrectly

    Python's optparse accepts long options also without the equals sign (e.g. --verbose 2). Django-nose fails to strip out the values of such Django options when creating the nose command line:

    $ ./manage.py test --verbosity 0
    ======================================================================
    ERROR: Failure: OSError (No such file /home/akaihola/testproject/0)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/pymodules/python2.6/nose/failure.py", line 39, in runTest
        raise self.exc_class(self.exc_val)
    OSError: No such file /home/akaihola/testproject/0
    
    ----------------------------------------------------------------------
    Ran 20 tests in 2.844s
    
    FAILED (errors=1)
    

    To solve this "correctly", some serious hacking with optparse is probably needed. Or, known Django options with arguments could be handled specially.

    Or maybe it would be possible to "merge" Django's and nose's option parsers?

    bug 
    opened by akaihola 13
  • Django legacy transaction management deprecated

    Django legacy transaction management deprecated

    As of March 21, 2014, some legacy transaction management features in the Django project have been deprecated and removed from the project: django/[email protected].

    I have a Makefile with the following (among other things):

    COMMON_REQUIREMENTS_FILE = arcadia/config/environments/common/requirements.txt
    
    DEVELOPMENT_REQUIREMENTS_FILE = arcadia/config/environments/development/requirements.txt
    
    TESTING_DATABASE_NAME = test_arcadia
    TESTING_DATABASE_OWNER = arcadia
    TESTING_SETTINGS_FILE = arcadia.config.environments.testing.settings
    
    test:
    REUSE_DB=1 python manage.py test --settings $(TESTING_SETTINGS_FILE)
    
    test-clean:
        sudo su - postgres -c 'psql -c "DROP DATABASE IF EXISTS $(TESTING_DATABASE_NAME);"'
        sudo su - postgres -c 'psql -c "CREATE DATABASE $(TESTING_DATABASE_NAME) WITH OWNER $(TESTING_DATABASE_OWNER);"'
        pip install -r $(COMMON_REQUIREMENTS_FILE)
        pip install -r $(DEVELOPMENT_REQUIREMENTS_FILE)
        python manage.py makemigrations --settings $(TESTING_SETTINGS_FILE)
        python manage.py migrate --settings $(TESTING_SETTINGS_FILE)
        REUSE_DB=1 python manage.py test --settings $(TESTING_SETTINGS_FILE)
    

    Running make test-clean produces the following:

    sudo su - postgres -c 'psql -c "DROP DATABASE IF EXISTS test_arcadia;"'
    NOTICE:  database "test_arcadia" does not exist, skipping
    DROP DATABASE
    sudo su - postgres -c 'psql -c "CREATE DATABASE test_arcadia WITH OWNER arcadia;"'
    CREATE DATABASE
    pip install -r arcadia/config/environments/common/requirements.txt
    Requirement already satisfied (use --upgrade to upgrade): Django==1.8 i /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from -r arcadia/config/environments/common/requirements.txt (line 1))
    Requirement already satisfied (use --upgrade to upgrade): psycopg2==2.6 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from -r arcadia/config/environments/common/requirements.txt (line 2))
    Requirement already satisfied (use --upgrade to upgrade): django-compressor==1.4 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from -r arcadia/config/environments/common/requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): django-appconf>=0.4 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from django-compressor==1.4->-r arcadia/config/environments/common/requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): six in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from django-appconf>=0.4->django-compressor==1.4->-r arcadia/config/environments/common/requirements.txt (line 3))
    pip install -r arcadia/config/environments/development/requirements.txt
    Obtaining file:///home/james/workspace/django-nose (from -r arcadia/config/environments/development/requirements.txt (line 5))
    Requirement already satisfied (use --upgrade to upgrade): django-debug-toolbar==1.3.0 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from -r arcadia/config/environments/development/requirements.txt (line 1))
    Requirement already satisfied (use --upgrade to upgrade): django-extensions==1.5.2 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from -r arcadia/config/environments/development/requirements.txt (line 2))
    Requirement already satisfied (use --upgrade to upgrade): nose==1.3.6 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from -r arcadia/config/environments/development/requirements.txt (line 3))
    Requirement already satisfied (use --upgrade to upgrade): Django>=1.4 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from django-nose==1.3->-r arcadia/config/environments/development/requirements.txt (line 5))
    Requirement already satisfied (use --upgrade to upgrade): sqlparse in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from django-debug-toolbar==1.3.0->-r arcadia/config/environments/development/requirements.txt (line 1))
    Requirement already satisfied (use --upgrade to upgrade): six>=1.2 in /home/james/.virtualenvs/arcadia/lib/python2.7/site-packages (from django-extensions==1.5.2->-r arcadia/config/environments/development/requirements.txt (line 2))
    Installing collected packages: django-nose
      Running setup.py develop for django-nose
    Successfully installed django-nose-1.3
    python manage.py makemigrations --settings arcadia.config.environments.testing.settings
    No changes detected
    python manage.py migrate --settings arcadia.config.environments.testing.settings
    Operations to perform:
      Synchronize unmigrated apps: members, staticfiles, messages, compressor, authentication,     django_nose
      Apply all migrations: admin, contenttypes, sites, auth, sessions
    Synchronizing apps without migrations:
      Creating tables...
        Running deferred SQL...
      Installing custom SQL...
    Running migrations:
      No migrations to apply.
    REUSE_DB=1 python manage.py test --settings arcadia.config.environments.testing.settings nosetests --verbosity=1
    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
        utility.execute()
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
        super(Command, self).run_from_argv(argv)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute
        super(Command, self).execute(*args, **options)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
        output = self.handle(*args, **options)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle
        failures = test_runner.run_tests(test_labels)
      File "/home/james/workspace/django-nose/django_nose/runner.py", line 349, in run_tests
        result = self.run_suite(nose_argv)
      File "/home/james/workspace/django-nose/django_nose/runner.py", line 296, in run_suite
        addplugins=plugins_to_add)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/core.py", line 121, in __init__
    **extra_args)
      File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
        self.runTests()
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/core.py", line 207, in runTests
        result = self.testRunner.run(self.test)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/core.py", line 50, in run
        wrapper = self.config.plugins.prepareTest(test)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
        return self.call(*arg, **kw)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
        result = meth(*arg, **kw)
      File "/home/james/workspace/django-nose/django_nose/plugin.py", line 76, in prepareTest
        self.old_names = self.runner.setup_databases()
      File "/home/james/workspace/django-nose/django_nose/runner.py", line 521, in setup_databases
        transaction.commit_unless_managed(using=connection.alias)
    AttributeError: 'module' object has no attribute 'commit_unless_managed'
    make: *** [test-clean] Error 1
    

    Running make test produces the same error:

    REUSE_DB=1 python manage.py test --settings arcadia.config.environments.testing.settings nosetests --verbosity=1
    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
        utility.execute()
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
        super(Command, self).run_from_argv(argv)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute
        super(Command, self).execute(*args, **options)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
        output = self.handle(*args, **options)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle
        failures = test_runner.run_tests(test_labels)
      File "/home/james/workspace/django-nose/django_nose/runner.py", line 349, in run_tests
        result = self.run_suite(nose_argv)
      File "/home/james/workspace/django-nose/django_nose/runner.py", line 296, in run_suite
        addplugins=plugins_to_add)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/core.py", line 121, in __init__
    **extra_args)
      File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
        self.runTests()
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/core.py", line 207, in runTests
        result = self.testRunner.run(self.test)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/core.py", line 50, in run
        wrapper = self.config.plugins.prepareTest(test)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
        return self.call(*arg, **kw)
      File "/home/james/.virtualenvs/arcadia/local/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
        result = meth(*arg, **kw)
      File "/home/james/workspace/django-nose/django_nose/plugin.py", line 76, in prepareTest
        self.old_names = self.runner.setup_databases()
      File "/home/james/workspace/django-nose/django_nose/runner.py", line 521, in setup_databases
        transaction.commit_unless_managed(using=connection.alias)
    AttributeError: 'module' object has no attribute 'commit_unless_managed'
    make: *** [test] Error 1
    

    This error doesn't occur after I remove sudo su - postgres -c 'psql -c "CREATE DATABASE $(TESTING_DATABASE_NAME) WITH OWNER $(TESTING_DATABASE_OWNER); from test-clean, but make test still causes it to happen.

    Running python manage.py test --settings arcadia.config.environments.testing.settings from the command line also solves the problem.

    Here is the offending line of code: django_nose/runner.py#L404.

    Please let me know if I can provide anything else that is helpful.

    bug 
    opened by jamesbrewerdev 12
  • (Django v1.5) confirm method removed from BaseDatabaseFeatures

    (Django v1.5) confirm method removed from BaseDatabaseFeatures

    Hello!

    On Django trunk, cached properties now keep track of database features like transaction support (https://github.com/django/django/commit/aa423575e7b464433fcfc4bf4b8e1d7627b17ce6).

    Because the confirm method was removed, attempting to run django-nose tests with REUSE_DB=1 generates an obscure 'SkipDatabaseCreation' object has no attribute '_rollback_works' AttributeError.

    See patch for workaround. And thanks for your work on django-nose!

    opened by dvelyk 12
  • Reset sequences only for tables that exists.

    Reset sequences only for tables that exists.

    If using multiple databases setup we need to make sure we aren't trying to reset sequences that doesn't exists in particular DB.

    I've faced problem with using REUSE_DB=1 with multidb setup. The problem was that NoseTestSuiteRunner.setup_databases() was trying to execute reset statements for all the models on every connection. My patch adds a check that the model's table is present in DB before executing reset statement.

    opened by shacka 12
  • selecting tests by attributes does not seem to work

    selecting tests by attributes does not seem to work

    If I specify an attribute via -a or --attr, no tests are run.

    If I set NOSE_ATTR, it seems to work, but I can't specify multiple attributes to limit the tests to ones which have all attributes. E.g., NOSE_ATTR='scope=local,hostname' seems to run all tests which have either a scope attribute of local, or a hostname attribute, not both. It's possible I'm not setting NOSE_ATTR correctly, however, as I've never needed to use it before.

    We're using django-nose 1.2, nose 1.3, and python 2.6. In our non-django projects, we're able to limit tests this way without issue.

    Expected outcome: Tests can be selected using attributes as per the documentation.

    bug 
    opened by shalonwood 11
  • Python 3 fixes

    Python 3 fixes

    Makes django-nose Django1.5/Python3 compatible. Includes some changes automatically made by 2to3 that are not required for Python2 but don't hurt either (assuming only Python >= 2.6 compatibility is required). This way it's not necessary to run 2to3 on the codebase.

    opened by jonashaag 11
  • Tests are not starting to run after upgrading to django nose 1.4 on Django 1.8 and nose 1.3.6

    Tests are not starting to run after upgrading to django nose 1.4 on Django 1.8 and nose 1.3.6

    Following is the exception I get on running REUSE_DB=1 ./manage.py test -s

    Traceback (most recent call last):
      File "./manage.py", line 21, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
        utility.execute()
      File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
        super(Command, self).run_from_argv(argv)
      File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 378, in run_from_argv
        parser = self.create_parser(argv[0], argv[1])
      File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 351, in create_parser
        self.add_arguments(parser)
      File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/django/core/management/commands/test.py", line 62, in add_arguments
        test_runner_class.add_arguments(parser)
      File "/Users/antonyr/projects/office/pa_web/src/django-nose/django_nose/runner.py", line 250, in add_arguments
        value = cls._argparse_type[value]
    KeyError: 'choice'
    

    Thanks in advance for the help.

    bug 
    opened by aamirtharaj-rpx 10
  • Assertions

    Assertions

    Hi!

    If I remember correctly, I tried to get these asserts merged a long time ago, but the README.rst file wasn't updated. I did something about that, and maybe you could either pull this or let me know what need to be done to get it in.

    Thanks!

    opened by mjtorn 10
  • Bump wheel from 0.29.0 to 0.38.1

    Bump wheel from 0.29.0 to 0.38.1

    Bumps wheel from 0.29.0 to 0.38.1.

    Changelog

    Sourced from wheel's changelog.

    Release Notes

    UNRELEASED

    • Updated vendored packaging to 22.0

    0.38.4 (2022-11-09)

    • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

    0.38.3 (2022-11-08)

    • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

    0.38.2 (2022-11-05)

    • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

    0.38.1 (2022-11-04)

    • Removed install dependency on setuptools
    • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

    0.38.0 (2022-10-21)

    • Dropped support for Python < 3.7
    • Updated vendored packaging to 21.3
    • Replaced all uses of distutils with setuptools
    • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
    • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
    • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

    0.37.1 (2021-12-22)

    • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
    • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

    0.37.0 (2021-08-09)

    • Added official Python 3.10 support
    • Updated vendored packaging library to v20.9

    ... (truncated)

    Commits
    • 6f1608d Created a new release
    • cf8f5ef Moved news item from PR #484 to its proper place
    • 9ec2016 Removed install dependency on setuptools (#483)
    • 747e1f6 Fixed PyPy SOABI parsing (#484)
    • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
    • 7b9e8e1 Test on Python 3.11 final
    • a04dfef Updated the pypi-publish action
    • 94bb62c Fixed docs not building due to code style changes
    • d635664 Updated the codecov action to the latest version
    • fcb94cd Updated version to match the release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Maintainers Needed

    Maintainers Needed

    This project continues to have active users, but it does not have active maintainers. If you are a user of this project, please consider becoming a maintainer. It is a natural extension of maintaining your own projects, you'll ensure your own tool is up-to-date now and in the future, and you'll gain skills that will help for future open- and closed-source work.

    I expect to have some free time in the next two months, until the second week of January 2023. If someone (ideally two or more people) want to learn project maintenance, I'll be available to mentor and assist during this period. Some of my goals are:

    • A 2.0 release, as specified on #311
    • Adopting Jazzband release standards, like setuptools_scm and auto-releases
    • Expanding the tests to look more like the Django test suite, with multiple projects focused on different feature sets.

    If you are interested, let me know in the comments, and read the guides at jazzband.co.

    opened by jwhitlock 1
  • Python 3.11 support

    Python 3.11 support

    I had to patch nose for django 2.2 on python 3.11 -

    # patch for nose (django-nose) for py3.11
    import collections
    collections.Callable = collections.abc.Callable
    # End of patch
    

    collections.Callable has a new location.

    opened by radzhome 0
  • Django 3.1: TypeError: sql_flush() takes 3 positional arguments but 4 were given

    Django 3.1: TypeError: sql_flush() takes 3 positional arguments but 4 were given

    Hi!

    After upgrade from Django 3.0 to 3.1, running my tests using django-nose gives me this exception:

    REUSE_DB=1 nosetests mypackage --with-fixture-bundling --with-parallel --with-xunit --verbosity=1
    
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/django/core/management/commands/test.py", line 53, in handle
        failures = test_runner.run_tests(test_labels)
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/django_nose/runner.py", line 308, in run_tests
        result = self.run_suite(nose_argv)
      File "~/Repos/myrepo/test_utils/nose/__init__.py", line 52, in run_suite
        return super(MyNoseRunner, self).run_suite(nose_argv)
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/django_nose/runner.py", line 244, in run_suite
        nose.core.TestProgram(argv=nose_argv, exit=False,
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/nose/core.py", line 118, in __init__
        unittest.TestProgram.__init__(
      File "~/.pyenv/versions/3.9.11/lib/python3.9/unittest/main.py", line 101, in __init__
        self.runTests()
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/nose/core.py", line 207, in runTests
        result = self.testRunner.run(self.test)
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/nose/core.py", line 50, in run
        wrapper = self.config.plugins.prepareTest(test)
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/nose/plugins/manager.py", line 99, in __call__
        return self.call(*arg, **kw)
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/nose/plugins/manager.py", line 167, in simple
        result = meth(*arg, **kw)
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/django_nose/plugin.py", line 82, in prepareTest
        self.old_names = self.runner.setup_databases()
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/django_nose/runner.py", line 466, in setup_databases
        reset_statements = _mysql_reset_sequences(
      File "~/.virtualenvs/web-django31/lib/python3.9/site-packages/django_nose/runner.py", line 405, in _mysql_reset_sequences
        flush_statements = connection.ops.sql_flush(
    TypeError: sql_flush() takes 3 positional arguments but 4 were given
    

    The implementation of MyNoseRunner:

    import re
    from django_nose import NoseTestSuiteRunner
    
    
    class MyNoseRunner(NoseTestSuiteRunner):
        def run_suite(self, nose_argv):
            stack = traceback.extract_stack()
            running_with_pycharm = any([re.findall('[Pp]y[cC]harm|pydev', str(item)) for item in stack])
    
            if running_with_pycharm:
                print('Apply PyCharm fix...\n')
                nose_argv[1] = convert_test_uri_to_nose_pattern(nose_argv[1])
    
            return super(MyNoseRunner, self).run_suite(nose_argv)
    

    The versions of my local environment:

    
    macOS Monterey 12.4
    Apple M1
    
    Python 3.9.11
    
    Django==3.1.14
    django-nose==1.4.7
    nose==1.3.7
    nose-parallel==0.4.0
    

    I've found an issue on other repo and there is:

    probably because the signature for sql_flush has changed (also in https://docs.djangoproject.com/en/3.1/releases/3.1/#backwards-incompatible-changes-in-3-1).
    
    Compare
    https://github.com/django/django/blob/3.0.9/django/db/backends/base/operations.py#L384
    vs
    https://github.com/django/django/blob/3.1/django/db/backends/base/operations.py#L392
    

    Thanks.

    opened by jklemm 0
  • Bump ipython from 5.4.1 to 7.16.3

    Bump ipython from 5.4.1 to 7.16.3

    Bumps ipython from 5.4.1 to 7.16.3.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Releases(v1.4.7)
  • v1.4.7(Aug 20, 2020)

  • v1.4.6(Oct 3, 2018)

  • v1.4.5(Aug 22, 2017)

  • v1.4.4(Jun 27, 2016)

  • v1.4.3(Dec 28, 2015)

    • Add Django 1.9 support
    • Support long options without equals signs, such as "--attr selected"
    • Support nose plugins using callback options
    • Support nose options without default values (@jsatt)
    • Remove Django from install dependencies, to avoid accidental upgrades (@jsocol, @willkg)
    • Setting REUSE_DB to an empty value now disables REUSE_DB, instead of enabling it (@wdoekes)
    Source code(tar.gz)
    Source code(zip)
  • v1.4.2(Oct 7, 2015)

    • Warn against using REUSE_DB=1 and FastFixtureTestCase in docs
    • REUSE_DB=1 uses new transaction management in Django 1.7, 1.8 (@scottsexton)
    • Try to avoid accidentally using production database with REUSE_DB=1 (@alexjg, @eroninjapan)
    • Supported Django versions limited to current supported Django version 1.4, 1.7, and 1.8, as well as relevant Python versions.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Oct 7, 2015)

    • Fix version number (@ezarowny)
    • Fix choice options, unbreaking nose-cover (@aamirtharaj-rpx, @jwhitlock)
    • Support 1.8 app loading system (@dgladkov)
    • Support non-ASCII file names (@singingwolfboy)
    • Better PEP8'd assertion names (@roganov)
    Source code(tar.gz)
    Source code(zip)
  • v1.4(Oct 7, 2015)

Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.

Prism is a set of packages for API mocking and contract testing with OpenAPI v2 (formerly known as Swagger) and OpenAPI v3.x. Mock Servers: Life-like

Stoplight 3.3k Jan 05, 2023
Fail tests that take too long to run

GitHub | PyPI | Issues pytest-fail-slow is a pytest plugin for making tests fail that take too long to run. It adds a --fail-slow DURATION command-lin

John T. Wodder II 4 Nov 27, 2022
A feature flipper for Django

README Django Waffle is (yet another) feature flipper for Django. You can define the conditions for which a flag should be active, and use it in a num

952 Jan 06, 2023
The (Python-based) mining software required for the Game Boy mining project.

ntgbtminer - Game Boy edition This is a version of ntgbtminer that works with the Game Boy bitcoin miner. ntgbtminer ntgbtminer is a no thrills getblo

Ghidra Ninja 31 Nov 04, 2022
Python script to automatically download from Zippyshare

Zippyshare downloader and Links Extractor Python script to automatically download from Zippyshare using Selenium package and Internet Download Manager

Daksh Khurana 2 Oct 31, 2022
a plugin for py.test that changes the default look and feel of py.test (e.g. progressbar, show tests that fail instantly)

pytest-sugar pytest-sugar is a plugin for pytest that shows failures and errors instantly and shows a progress bar. Requirements You will need the fol

Teemu 963 Dec 28, 2022
A twitter bot that simply replies with a beautiful screenshot of the tweet, powered by poet.so

Poet this! Replies with a beautiful screenshot of the tweet, powered by poet.so Installation git clone https://github.com/dhravya/poet-this.git cd po

Dhravya Shah 30 Dec 04, 2022
The definitive testing tool for Python. Born under the banner of Behavior Driven Development (BDD).

mamba: the definitive test runner for Python mamba is the definitive test runner for Python. Born under the banner of behavior-driven development. Ins

Néstor Salceda 502 Dec 30, 2022
LuluTest is a Python framework for creating automated browser tests.

LuluTest LuluTest is an open source browser automation framework using Python and Selenium. It is relatively lightweight in that it mostly provides wr

Erik Whiting 14 Sep 26, 2022
The best, free, all in one, multichecking, pentesting utility

The best, free, all in one, multichecking, pentesting utility

Mickey 58 Jan 03, 2023
Python Testing Crawler 🐍 🩺 🕷️ A crawler for automated functional testing of a web application

Python Testing Crawler 🐍 🩺 🕷️ A crawler for automated functional testing of a web application Crawling a server-side-rendered web application is a

70 Aug 07, 2022
A framework-agnostic library for testing ASGI web applications

async-asgi-testclient Async ASGI TestClient is a library for testing web applications that implements ASGI specification (version 2 and 3). The motiva

122 Nov 22, 2022
Automatic SQL injection and database takeover tool

sqlmap sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of

sqlmapproject 25.7k Jan 04, 2023
自动化爬取并自动测试所有swagger-ui.html显示的接口

swagger-hack 在测试中偶尔会碰到swagger泄露 常见的泄露如图: 有的泄露接口特别多,每一个都手动去试根本试不过来 于是用python写了个脚本自动爬取所有接口,配置好传参发包访问 原理是首先抓取http://url/swagger-resources 获取到有哪些标准及对应的文档地

jayus 534 Dec 29, 2022
Minimal example of how to use pytest with automated 'devops' style automated test runs

Pytest python example with automated testing This is a minimal viable example of pytest with an automated run of tests for every push/merge into the m

Karma Computing 2 Jan 02, 2022
Show coverage stats online via coveralls.io

Coveralls for Python Test Status: Version Info: Compatibility: Misc: coveralls.io is a service for publishing your coverage stats online. This package

Kevin James 499 Dec 28, 2022
Repository for JIDA SNP Browser Web Application: Local Deployment

JIDA JIDA is a web application that retrieves SNP information for a genomic region of interest in Homo sapiens and calculates specific summary statist

3 Mar 03, 2022
splinter - python test framework for web applications

splinter - python tool for testing web applications splinter is an open source tool for testing web applications using Python. It lets you automate br

Cobra Team 2.6k Dec 27, 2022
Declarative HTTP Testing for Python and anything else

Gabbi Release Notes Gabbi is a tool for running HTTP tests where requests and responses are represented in a declarative YAML-based form. The simplest

Chris Dent 139 Sep 21, 2022
A simple tool to test internet stability.

pingtest Description A personal project for testing internet stability, intended for use in Linux and Windows.

chris 0 Oct 17, 2021