← 输入框|github.com|刷新
Skip to content

add posargs in tox.ini (single test cases) #145

Closed

Description

@tomschr

Situation

Usually you run tox like this:

tox -e py36

That works, all fine. However, it runs the complete test suite. If you work on a single test function, it is currently not possible to run this alone. You always have to run the complete test suite.

Proposed Solution

I would propose the following small patch to introduce the posargs argument:

diff --git c/tox.ini i/tox.ini
index e172f8a..f7b1b2e 100644
--- c/tox.ini
+++ i/tox.ini
@@ -5,7 +5,7 @@ envlist =
     pypy
 
 [testenv]
-commands = py.test
+commands = py.test {posargs:}

This makes it possible to run tox only for the test function test_should_bump_major:

tox -e py36 test_semver.py::test_should_bump_major

With this single patch, it is even possible to use it for the setup.py script:

python3 setup.py test -a "-e py36 test_semver.py::test_should_bump_major"

Activity

  1. added a commit that references this issue on Sep 30, 2019
    3bd7305
  2. changed the title [-]Improve tox.ini to allow running single test cases[/-] [+]add posargs in tox.ini (single test cases)[/+] on Sep 30, 2019
  3. added a commit that references this issue on Oct 1, 2019
    f60e11c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    SIze

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions