Skip to content

Commit 9cb42e1

Browse files
authored
Merge pull request #4910 from jfly/update-run-tests-instructions
2 parents c8f34dd + 08a7fcf commit 9cb42e1

File tree

8 files changed

+22
-74
lines changed

8 files changed

+22
-74
lines changed

.dockerignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ General Guidelines
2929
Pipenv has one very important rule governing all forms of contribution,
3030
including reporting bugs or requesting features. This golden rule is
3131
\"[be cordial or be on your
32-
way](https://www.kennethreitz.org/essays/be-cordial-or-be-on-your-way)\".
32+
way](https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way)\".
3333

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

@@ -115,13 +115,9 @@ details.
115115

116116
### Testing
117117

118-
Tests are written in `pytest` style and can be run very simply:
118+
Tests are written in `pytest` style.
119119

120-
``` {.sh}
121-
pytest
122-
```
123-
124-
This will run all Pipenv tests, which can take awhile. To run a subset
120+
Running all tests can take awhile. To run a subset
125121
of the tests, the standard pytest filters are available, such as:
126122

127123
- provide a directory or file: `pytest tests/unit` or
@@ -218,11 +214,11 @@ following things when filing bug reports:
218214
Run the tests
219215
-------------
220216

221-
Three ways of running the tests are as follows:
217+
Two ways of running the tests are as follows:
222218

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

227223
``` {.console}
228224
$ git clone https://github.com/pypa/pipenv.git
@@ -232,7 +228,7 @@ $ pipenv install --dev
232228
$ pipenv run pytest
233229
```
234230

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

Dockerfile

Lines changed: 0 additions & 39 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include LICENSE README.md CONTRIBUTING.md CHANGELOG.rst NOTICES HISTORY.txt
2-
include Makefile pyproject.toml get-pipenv.py .dockerignore *.yml
2+
include Makefile pyproject.toml get-pipenv.py *.yml
33
include examples/Pipfil*
44
include *.md
55
recursive-include pipenv LICENSE LICENSE* *LICENSE* *COPYING* t32.exe t64.exe w32.exe w64.exe cacert.pem
@@ -20,7 +20,6 @@ include pipenv/pipenv.1
2020
exclude .gitmodules
2121
exclude .editorconfig .travis.yml .env appveyor.yml tox.ini pytest.ini
2222
exclude Pipfile* CHANGELOG.draft.rst
23-
exclude docker-compose.yml Dockerfile
2423
exclude run-tests.sh run-tests.bat
2524

2625
recursive-include docs Makefile *.rst *.py *.bat

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ piptools-checkout-dir = $(get_checkout_dir)/patch-piptools
2323

2424
format:
2525
black pipenv/*.py
26-
test:
27-
docker-compose up
2826

2927
.PHONY: install
3028
install:

docker-compose.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

pipenv/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,8 @@ def do_run(project, command, args, three=None, python=False, pypi_mirror=None):
24962496
click.echo("Can't run script {0!r}-it's empty?", err=True)
24972497
run_args = [project, script]
24982498
run_kwargs = {'env': env}
2499+
# We're using `do_run_nt` on CI (even if we're running on a non-nt machine)
2500+
# as a workaround for https://github.com/pypa/pipenv/issues/4909.
24992501
if os.name == "nt" or environments.PIPENV_IS_CI:
25002502
run_fn = do_run_nt
25012503
else:

tests/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
import pytest
2+
import os
3+
4+
# Note that we have to do this *before* `pipenv.environments` gets imported,
5+
# which is why we're doing it here as a side effect of importing this module.
6+
# CI=1 is necessary as a workaround for https://github.com/pypa/pipenv/issues/4909
7+
os.environ['CI'] = '1'
8+
9+
def pytest_sessionstart(session):
10+
import pipenv.environments
11+
assert pipenv.environments.PIPENV_IS_CI
212

313

414
@pytest.fixture()

0 commit comments

Comments
 (0)