Skip to content

Commit 73aa617

Browse files
Merge pull request #54 from smokestacklightnin/ci/tests/add-pytest
Run tests with PyTest and Add workflow
2 parents 5cb8dc5 + 425bb6c commit 73aa617

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
paths-ignore:
7+
- '**.md'
8+
- 'docs/**'
9+
workflow_dispatch:
10+
11+
env:
12+
USE_BAZEL_VERSION: "7.6.1"
13+
14+
jobs:
15+
tests:
16+
runs-on: ubuntu-latest
17+
18+
19+
strategy:
20+
matrix:
21+
python-version: ['3.9', '3.10', '3.11', '3.12']
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
cache: 'pip'
31+
cache-dependency-path: |
32+
setup.py
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
python -m pip install .[test]
38+
39+
- name: Run unit tests
40+
shell: bash
41+
run: |
42+
pytest

pytest.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[pytest]
2+
addopts = -ra
3+
testpaths =
4+
tensorflow_metadata

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ def run(self):
140140
],
141141
python_requires=">=3.9,<4",
142142
packages=find_packages(),
143-
extra_requires={
143+
extras_require={
144144
"dev": ["precommit"],
145+
"test": [
146+
"pytest>=8,<9",
147+
],
145148
},
146149
include_package_data=True,
147150
description="Library and standards for schema and statistics.",

0 commit comments

Comments
 (0)