Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pytest from 7.4.4 to 8.1.1 #3396

Merged
merged 6 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ help:
@echo " migrate run the kinto migrations"
@echo " lint run the code linters"
@echo " tests run all the tests with all the supported python interpreters (same as CI)"
@echo " test-deps pulls and runs docker postgres and memcached containers for tests"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be mentioned in contribution docs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a small change to community.rst, but we probably need to give everything a once over. I saw some dated communication channels in there.

@echo " tdd run pytest-watch to rerun tests automatically on changes for tdd"
@echo " tests-once only run the tests once with the default python interpreter"
@echo " tests-once only run the tests once with the default python interpreter"
@echo " functional run functional test against a real kinto"
@echo " browser-test run browser test against a real kinto"
@echo " clean remove *.pyc files and __pycache__ directory"
Expand Down Expand Up @@ -94,6 +95,14 @@ tests: install-postgres install-monitoring install-memcached version-file instal
tests-raw: version-file install-dev
$(VENV)/bin/py.test

test-deps:
docker pull memcached
docker pull postgres
docker run -p 11211:11211 --name kinto-memcached -d memcached || echo "cannot start memcached, already exists?"
docker run -p 5432:5432 --name kinto-postgres -e POSTGRES_PASSWORD=postgres -d postgres || echo "cannot start postgres, already exists?"
sleep 2
PGPASSWORD=postgres psql -c "CREATE DATABASE testdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres -h localhost

lint: install-dev
$(VENV)/bin/ruff check kinto tests docs/conf.py
$(VENV)/bin/ruff format --check kinto tests docs/conf.py
Expand Down Expand Up @@ -123,6 +132,8 @@ clean:
find . -name '*.pyc' -delete
find . -name '__pycache__' -type d | xargs rm -fr
rm -fr docs/_build/
docker rm -f kinto-memcached || echo ""
docker rm -f kinto-postgres || echo ""

distclean: clean
rm -fr *.egg *.egg-info/ dist/ build/
Expand Down
4 changes: 2 additions & 2 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ plaster-pastedeploy==1.0.1
# via pyramid
playwright==1.42.0
# via -r constraints.in
pluggy==1.3.0
pluggy==1.4.0
# via pytest
psycopg2==2.9.9
# via -r constraints.in
Expand All @@ -121,7 +121,7 @@ pyramid-multiauth==1.0.1
# via -r constraints.in
pyramid-tm==2.5
# via -r constraints.in
pytest==7.4.4
pytest==8.1.1
# via
# -r constraints.in
# pytest-cache
Expand Down
9 changes: 9 additions & 0 deletions tests/core/resource/test_views_cors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def setUpClass(cls):
super().setUpClass()
cls.headers["Origin"] = "notmyidea.org"

@classmethod
def tearDownClass(cls):
cls.headers.pop("Origin", None)

def setUp(self):
super().setUp()
body = {"data": MINIMALIST_OBJECT}
Expand Down Expand Up @@ -217,6 +221,11 @@ def setUpClass(cls):
super().setUpClass()
cls.headers.update({"Origin": "lolnet.org", "Access-Control-Request-Method": "GET"})

@classmethod
def tearDownClass(cls):
cls.headers.pop("Access-Control-Request-Method", None)
cls.headers.pop("Origin", None)

def test_cors_max_age_is_3600_seconds_by_default(self):
app = self.make_app()
resp = app.options("/", headers=self.headers)
Expand Down
File renamed without changes.
Loading