Skip to content

Commit

Permalink
Drop contexter from test requirements (#426)
Browse files Browse the repository at this point in the history
The contexter package is a third-party backport of contextlib (with some
extensions). It is no longer required because Nox does not support Python 2
anymore, and we only ever used the standard ExitStack interface.

The contexter package was used only in the test suite.
  • Loading branch information
cjolowicz committed May 23, 2021
1 parent 99c5910 commit a6539a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def conda_tests(session):
session.conda_install(
"--file", "requirements-conda-test.txt", "--channel", "conda-forge"
)
session.install("contexter", "--no-deps")
session.install("-e", ".", "--no-deps")
tests = session.posargs or ["tests/"]
session.run("pytest", *tests)
Expand Down
1 change: 0 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
flask
pytest
pytest-cov
contexter
sphinx
sphinx-autobuild
recommonmark
Expand Down
6 changes: 3 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import contextlib
import os
import sys
from pathlib import Path
from unittest import mock

import contexter
import nox
import nox.__main__
import nox._options
Expand Down Expand Up @@ -296,7 +296,7 @@ def test_main_positional_flag_like_with_double_hyphen(monkeypatch):
def test_main_version(capsys, monkeypatch):
monkeypatch.setattr(sys, "argv", [sys.executable, "--version"])

with contexter.ExitStack() as stack:
with contextlib.ExitStack() as stack:
execute = stack.enter_context(mock.patch("nox.workflow.execute"))
exit_mock = stack.enter_context(mock.patch("sys.exit"))
nox.__main__.main()
Expand All @@ -309,7 +309,7 @@ def test_main_version(capsys, monkeypatch):
def test_main_help(capsys, monkeypatch):
monkeypatch.setattr(sys, "argv", [sys.executable, "--help"])

with contexter.ExitStack() as stack:
with contextlib.ExitStack() as stack:
execute = stack.enter_context(mock.patch("nox.workflow.execute"))
exit_mock = stack.enter_context(mock.patch("sys.exit"))
nox.__main__.main()
Expand Down

0 comments on commit a6539a7

Please sign in to comment.