Skip to content

Commit

Permalink
Add another test
Browse files Browse the repository at this point in the history
This should chatch the issue in conda-forge#67 if it hasn't been solved yet.
  • Loading branch information
xylar committed Sep 7, 2023
1 parent c985959 commit f8d15da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ outputs:
test:
requires:
- pip
- pytest
files:
- test.py
imports:
- apache_beam
- apache_beam.coders
Expand Down Expand Up @@ -105,6 +108,7 @@ outputs:
- apache_beam.utils
commands:
- pip check
- pytest test.py

- name: {{ name }}-with-gcp
requirements:
Expand Down
23 changes: 23 additions & 0 deletions recipe/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import apache_beam as beam
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import assert_that


def expected_nums():
def _expected_nums(actual):
assert actual[0] == 0
assert actual[1] == 1

return _expected_nums


def test_pipeline_without_assert_that():
with TestPipeline() as p:
_ = p | beam.Create([0, 1])


def test_assert_that():
with TestPipeline() as p:
nums = p | beam.Create([0, 1])
assert_that(nums, expected_nums())

0 comments on commit f8d15da

Please sign in to comment.