Skip to content

Commit

Permalink
Fix invalid escape sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile authored and davehunt committed Jul 3, 2018
1 parent 3b47760 commit c821f12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testing/test_destructive.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_skip_destructive_by_default(testdir):


def test_warn_when_url_is_sensitive(testdir, httpserver, monkeypatch, capsys):
monkeypatch.setenv('SENSITIVE_URL', '127\.0\.0\.1')
monkeypatch.setenv('SENSITIVE_URL', r'127\.0\.0\.1')
file_test = testdir.makepyfile('def test_pass(): pass')
testdir.quick_qa(file_test, '--verbose', passed=0, failed=0, skipped=1)
out, err = capsys.readouterr()
Expand All @@ -24,18 +24,18 @@ def test_warn_when_url_is_sensitive(testdir, httpserver, monkeypatch, capsys):
def test_skip_destructive_when_sensitive_command_line(testdir, httpserver):
file_test = testdir.makepyfile('def test_pass(): pass')
print(httpserver.url)
testdir.quick_qa('--sensitive-url', '127\.0\.0\.1', file_test, passed=0,
testdir.quick_qa('--sensitive-url', r'127\.0\.0\.1', file_test, passed=0,
failed=0, skipped=1)


def test_skip_destructive_when_sensitive_config_file(testdir, httpserver):
testdir.makefile('.ini', pytest='[pytest]\nsensitive_url=127\.0\.0\.1')
testdir.makefile('.ini', pytest='[pytest]\nsensitive_url=127\\.0\\.0\\.1')
file_test = testdir.makepyfile('def test_pass(): pass')
testdir.quick_qa(file_test, passed=0, failed=0, skipped=1)


def test_skip_destructive_when_sensitive_env(testdir, httpserver, monkeypatch):
monkeypatch.setenv('SENSITIVE_URL', '127\.0\.0\.1')
monkeypatch.setenv('SENSITIVE_URL', r'127\.0\.0\.1')
file_test = testdir.makepyfile('def test_pass(): pass')
testdir.quick_qa(file_test, passed=0, failed=0, skipped=1)

Expand Down

0 comments on commit c821f12

Please sign in to comment.