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 2b1c535c12
3 changed files with 14 additions and 1 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):
mock_which.return_value = False
@ -15,6 +17,7 @@ def test_publish_heroku_requires_heroku(mock_which):
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")
@ -44,6 +47,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")
@ -79,6 +83,7 @@ def test_publish_heroku(mock_call, mock_check_output, mock_which):
)
@pytest.mark.serial
@mock.patch("shutil.which")
@mock.patch("datasette.publish.heroku.check_output")
@mock.patch("datasette.publish.heroku.call")