Skip to content

Commit

Permalink
Add tests of the modified python files.
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Mar 28, 2024
1 parent 039bf02 commit b0acccf
Show file tree
Hide file tree
Showing 27 changed files with 170 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_flake8_dunder_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# 3rd party
import pytest
from coincidence.regressions import AdvancedFileRegressionFixture
from common import (
mangled_source,
results,
Expand Down Expand Up @@ -157,6 +158,7 @@ def test_check_and_add_all(tmp_pathplus: PathPlus, source: str, members: List[st
tmpfile.write_text(source)

assert check_and_add_all(tmpfile) == ret
advanced_file_regression.check_file(tmpfile)

if members:
members_string = ", ".join(f'"{m}"' for m in members)
Expand Down Expand Up @@ -190,11 +192,18 @@ def test_check_and_add_all(tmp_pathplus: PathPlus, source: str, members: List[st
pytest.param(testing_source_l, [], 0, id="typing.overload"),
]
)
def test_check_and_add_all_tuples(tmp_pathplus: PathPlus, source: str, members: List[str], ret: int):
def test_check_and_add_all_tuples(
tmp_pathplus: PathPlus,
source: str,
members: List[str],
ret: int,
advanced_file_regression: AdvancedFileRegressionFixture
):
tmpfile = tmp_pathplus / "source.py"
tmpfile.write_text(source)

assert check_and_add_all(tmpfile, use_tuple=True) == ret
advanced_file_regression.check_file(tmpfile)

if members:
members_string = ", ".join(f'"{m}"' for m in members)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

"""a docstring"""
import foo

__all__ = ["a_function"]


async def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

"""a docstring"""
import foo

__all__ = ["Foo"]


class Foo: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from foo import bar
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

"""a docstring"""
import foo

__all__ = ["Foo", "a_function"]


class Foo: ...

def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

"""a docstring"""
import foo

__all__ = ["Foo", "a_function"]

class Foo: ...

def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

"""a docstring"""
import foo


__version__: str = "1.2.3"
__all__ = ["Foo", "a_function"]

class Foo: ...

def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

"""a docstring"""
import foo

__all__ = ["a_function"]


def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

"""a docstring"""
import foo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""a docstring"""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

"""a docstring"""
import foo

__all__ = ["a_function"]




async def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

"""a docstring"""

@overload
def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

"""a docstring"""
import foo

__all__ = ("a_function", )


async def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

"""a docstring"""
import foo

__all__ = ("Foo", )


class Foo: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from foo import bar
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

"""a docstring"""
import foo

__all__ = ("Foo", "a_function", )


class Foo: ...

def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

"""a docstring"""
import foo

__all__ = ("Foo", "a_function", )

class Foo: ...

def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

"""a docstring"""
import foo


__version__: str = "1.2.3"
__all__ = ("Foo", "a_function", )

class Foo: ...

def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

"""a docstring"""
import foo

__all__ = ("a_function", )


def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

"""a docstring"""
import foo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""a docstring"""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import foo
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

"""a docstring"""
import foo

__all__ = ("a_function", )




async def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

"""a docstring"""

@overload
def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

"""a docstring"""

@typing.overload
def a_function(): ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

"""a docstring"""

@typing.overload
def a_function(): ...

0 comments on commit b0acccf

Please sign in to comment.