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

FIX: Don't try to add pytest mark to doctest, it seems to apply to *all* doctests #621

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 0 additions & 10 deletions core/src/zeit/connector/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from sqlalchemy.exc import OperationalError
import docker
import plone.testing
import pytest
import requests
import sqlalchemy
import transaction
Expand Down Expand Up @@ -320,7 +319,6 @@ def get_resource(self, name, body=b'', properties=None, contentType='text/plain'
)


@pytest.mark.slow()
class ConnectorTest(TestCase):
layer = REAL_CONNECTOR_LAYER
level = 2
Expand All @@ -343,14 +341,6 @@ def FunctionalDocFileSuite(*paths, **kw):
return zeit.cms.testing.FunctionalDocFileSuite(*paths, **kw)


def mark_doctest_suite(suite, mark):
# Imitate pytest magic, see _pytest.python.transfer_markers
for test in suite:
func = test.runTest.__func__
mark(func)
test.runTest = func.__get__(test)


def print_tree(connector, base):
"""Helper to print a tree."""
print('\n'.join(list_tree(connector, base)))
Expand Down
3 changes: 0 additions & 3 deletions core/src/zeit/connector/tests/test_doctest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import unittest

import pytest

import zeit.cms.testing
import zeit.connector.connector
import zeit.connector.testing
Expand All @@ -23,7 +21,6 @@ def test_suite():
'invalidation-events.txt',
layer=zeit.connector.testing.ZOPE_CONNECTOR_LAYER,
)
zeit.connector.testing.mark_doctest_suite(functional, pytest.mark.slow)
suite.addTest(functional)

suite.addTest(zeit.cms.testing.DocFileSuite('search.txt', package='zeit.connector'))
Expand Down
6 changes: 1 addition & 5 deletions core/src/zeit/connector/tests/test_doctest2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

import zeit.cms.testing
import zeit.connector.connector
import zeit.connector.testing
Expand All @@ -8,7 +6,7 @@
def test_suite():
# Need to put this into a separate file, otherwise gocept.pytestlayers
# does not tear down other layers before running this.
suite = zeit.connector.testing.FunctionalDocFileSuite(
return zeit.connector.testing.FunctionalDocFileSuite(
'locking.txt',
'resource.txt',
'search-ft.txt',
Expand All @@ -17,5 +15,3 @@ def test_suite():
# 'stressing.txt',
layer=zeit.connector.testing.REAL_CONNECTOR_LAYER,
)
zeit.connector.testing.mark_doctest_suite(suite, pytest.mark.slow)
return suite
5 changes: 0 additions & 5 deletions core/src/zeit/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@ def pytest_configure(config):
config.addinivalue_line(
'markers', 'integration: Thirdparty integration tests are not run by default.'
)
config.addinivalue_line(
'markers',
'slow: This is a non-unit test and thus is not run by '
'default. Use ``-m slow`` to run these, or ``-m 1`` to run all tests.',
)
config.addinivalue_line('markers', 'selenium: Selenium tests are not run by default.')
Loading