Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Add initial compatibility test.
Browse files Browse the repository at this point in the history
The compatibility test is currently failing from what looks like an
error with flake8. (It is unable to process files in a nested directory
when `--enable-extensions=TRUE` is passed to it.)

Also, add poetry config.
  • Loading branch information
terrencepreilly committed Oct 17, 2019
1 parent 9018557 commit 53054cd
Show file tree
Hide file tree
Showing 5 changed files with 477 additions and 12 deletions.
33 changes: 33 additions & 0 deletions integration_tests/compatibility.py
@@ -0,0 +1,33 @@
"""Tests for compatibility with other flake8 plugins."""

import subprocess
from unittest import TestCase

# Regression introduced by flake8 in 3.3.0
# Bad: 3.3.0

class CompatibilityTest(TestCase):

def test_flake8_docstrings(self):
proc = subprocess.run([
'flake8',
'--isolated',
'--enable-extensions=TRUE',
'integration_tests/files/example-ascii.py',
], stdout=subprocess.PIPE
)
result = proc.stdout.decode('utf8')
print(result)

self.assertTrue(
'D401' in result,
'The file should contain an error from flake8-docstrings.',
)
self.assertTrue(
'RST399' in result,
'The file should contain an error from flake8-rst-docstrings',
)
self.assertTrue(
'DAR101' in result,
'The file should contain an error from darglint.',
)
16 changes: 16 additions & 0 deletions integration_tests/files/problematic.py
@@ -0,0 +1,16 @@

def problematic_function(arg1):
"""Returns double the value of the first argument.
Args:
a: The first argument.
Returns:
Two times the value of the first argument.
"""
return arg1 * 2


def problematic_rst():
""""""

0 comments on commit 53054cd

Please sign in to comment.