pytest.mark.serial for any test using isolated_filesystem(), refs #1406

This commit is contained in:
Simon Willison 2021-07-29 17:44:16 -07:00
commit b46856391d
3 changed files with 14 additions and 0 deletions

View file

@ -1,8 +1,10 @@
from click.testing import CliRunner
from datasette import cli
from unittest import mock
import pytest
@pytest.mark.serial
@mock.patch("shutil.which")
def test_publish_heroku_requires_heroku(mock_which, tmp_path_factory):
mock_which.return_value = False
@ -15,6 +17,7 @@ def test_publish_heroku_requires_heroku(mock_which, tmp_path_factory):
assert "Publishing to Heroku requires heroku" in result.output
@pytest.mark.serial
@mock.patch("shutil.which")
@mock.patch("datasette.publish.heroku.check_output")
@mock.patch("datasette.publish.heroku.call")
@ -46,6 +49,7 @@ def test_publish_heroku_invalid_database(mock_which):
assert "Path 'woop.db' does not exist" in result.output
@pytest.mark.serial
@mock.patch("shutil.which")
@mock.patch("datasette.publish.heroku.check_output")
@mock.patch("datasette.publish.heroku.call")
@ -81,6 +85,7 @@ def test_publish_heroku(mock_call, mock_check_output, mock_which, tmp_path_facto
)
@pytest.mark.serial
@mock.patch("shutil.which")
@mock.patch("datasette.publish.heroku.check_output")
@mock.patch("datasette.publish.heroku.call")