Skip to content

Commit

Permalink
Merge pull request #4910 from jfly/update-run-tests-instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored Jan 8, 2022
2 parents c8f34dd + 08a7fcf commit 9cb42e1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 74 deletions.
11 changes: 0 additions & 11 deletions .dockerignore

This file was deleted.

22 changes: 9 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ General Guidelines
Pipenv has one very important rule governing all forms of contribution,
including reporting bugs or requesting features. This golden rule is
\"[be cordial or be on your
way](https://www.kennethreitz.org/essays/be-cordial-or-be-on-your-way)\".
way](https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way)\".

**All contributions are welcome**, as long as everyone involved is
treated with respect.
Expand Down Expand Up @@ -87,7 +87,7 @@ When contributing code, you\'ll want to follow this checklist:
6. Make your change.
7. Run the entire test suite again, confirming that all tests pass
*including the ones you just added*.
8. Send a GitHub Pull Request to the main repository\'s `master`
8. Send a GitHub Pull Request to the main repository\'s `main`
branch. GitHub Pull Requests are the expected method of code
collaboration on this project.

Expand Down Expand Up @@ -115,13 +115,9 @@ details.

### Testing

Tests are written in `pytest` style and can be run very simply:
Tests are written in `pytest` style.

``` {.sh}
pytest
```

This will run all Pipenv tests, which can take awhile. To run a subset
Running all tests can take awhile. To run a subset
of the tests, the standard pytest filters are available, such as:

- provide a directory or file: `pytest tests/unit` or
Expand Down Expand Up @@ -218,11 +214,11 @@ following things when filing bug reports:
Run the tests
-------------

Three ways of running the tests are as follows:
Two ways of running the tests are as follows:

1. `make test` (which uses `docker`)
2. `./run-tests.sh` or `run-tests.bat`
3. Using pipenv:
1. `./run-tests.sh` or `run-tests.bat`
- NOTE: `./run-tests.sh` is not working right now due to [this issue](https://github.com/pypa/pip/issues/7953#issuecomment-611928262).
2. Using pipenv:

``` {.console}
$ git clone https://github.com/pypa/pipenv.git
Expand All @@ -232,7 +228,7 @@ $ pipenv install --dev
$ pipenv run pytest
```

For the last two, it is important that your environment is setup
To run tests, it is important that your environment is setup
correctly, and this may take some work, for example, on a specific Mac
installation, the following steps may be needed:

Expand Down
39 changes: 0 additions & 39 deletions Dockerfile

This file was deleted.

3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE README.md CONTRIBUTING.md CHANGELOG.rst NOTICES HISTORY.txt
include Makefile pyproject.toml get-pipenv.py .dockerignore *.yml
include Makefile pyproject.toml get-pipenv.py *.yml
include examples/Pipfil*
include *.md
recursive-include pipenv LICENSE LICENSE* *LICENSE* *COPYING* t32.exe t64.exe w32.exe w64.exe cacert.pem
Expand All @@ -20,7 +20,6 @@ include pipenv/pipenv.1
exclude .gitmodules
exclude .editorconfig .travis.yml .env appveyor.yml tox.ini pytest.ini
exclude Pipfile* CHANGELOG.draft.rst
exclude docker-compose.yml Dockerfile
exclude run-tests.sh run-tests.bat

recursive-include docs Makefile *.rst *.py *.bat
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ piptools-checkout-dir = $(get_checkout_dir)/patch-piptools

format:
black pipenv/*.py
test:
docker-compose up

.PHONY: install
install:
Expand Down
7 changes: 0 additions & 7 deletions docker-compose.yml

This file was deleted.

2 changes: 2 additions & 0 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2496,6 +2496,8 @@ def do_run(project, command, args, three=None, python=False, pypi_mirror=None):
click.echo("Can't run script {0!r}-it's empty?", err=True)
run_args = [project, script]
run_kwargs = {'env': env}
# We're using `do_run_nt` on CI (even if we're running on a non-nt machine)
# as a workaround for https://github.com/pypa/pipenv/issues/4909.
if os.name == "nt" or environments.PIPENV_IS_CI:
run_fn = do_run_nt
else:
Expand Down
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import pytest
import os

# Note that we have to do this *before* `pipenv.environments` gets imported,
# which is why we're doing it here as a side effect of importing this module.
# CI=1 is necessary as a workaround for https://github.com/pypa/pipenv/issues/4909
os.environ['CI'] = '1'

def pytest_sessionstart(session):
import pipenv.environments
assert pipenv.environments.PIPENV_IS_CI


@pytest.fixture()
Expand Down

0 comments on commit 9cb42e1

Please # to comment.