Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions helloworld/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ python_sources(
name="lib",
)

python_test_utils()

# This target allows us to bundle our app into a PEX binary file via
# `./pants package`. We can also run it with `./pants run`. See
# https://www.pantsbuild.org/docs/python-package-goal and
Expand Down
2 changes: 2 additions & 0 deletions helloworld/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest_plugins = ["helloworld.plugins.handy"]
collect_ignore = ["translator"]
4 changes: 4 additions & 0 deletions helloworld/greet/greeting_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
def test_greeter() -> None:
greeter = Greeter(translations={"hello": {"es": "hola"}})
assert greeter.greet("test") == "Hola, test!"


def test_string_infer(simple_fixture) -> None:
assert simple_fixture == "hello"
1 change: 1 addition & 0 deletions helloworld/plugins/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python_test_utils(sources=["handy.py"])
Empty file added helloworld/plugins/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions helloworld/plugins/handy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


@pytest.fixture
def simple_fixture():
return "hello"
3 changes: 3 additions & 0 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ org = "example-python"

[buildsense]
enable = false

[python-infer]
string_imports = true