Skip to content

Commit 7fb1420

Browse files
committed
Merge branch 'main' into Py310Unions
2 parents 7a8b308 + 307fe24 commit 7fb1420

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed

.github/workflows/code-coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: code-coverage
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [ main ]
55
jobs:
66
run:
77
runs-on: ubuntu-latest
88
env:
99
PYTHON: '3.9'
1010
steps:
11-
- uses: actions/checkout@master
11+
- uses: actions/checkout@main
1212
- name: Setup Python
13-
uses: actions/setup-python@master
13+
uses: actions/setup-python@main
1414
with:
1515
python-version: 3.9
1616
- name: Generate coverage report

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: tests
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ main ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ main ]
1111

1212
jobs:
1313
build:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/typed-argument-parser)](https://badge.fury.io/py/typed-argument-parser)
88
[![PyPI version](https://badge.fury.io/py/typed-argument-parser.svg)](https://badge.fury.io/py/typed-argument-parser)
99
[![Build Status](https://github.com/swansonk14/typed-argument-parser/workflows/tests/badge.svg)](https://github.com/swansonk14/typed-argument-parser)
10-
[![codecov](https://codecov.io/gh/swansonk14/typed-argument-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/swansonk14/typed-argument-parser)
11-
[![license](https://img.shields.io/github/license/swansonk14/typed-argument-parser.svg)](https://github.com/swansonk14/typed-argument-parser/blob/master/LICENSE.txt)
10+
[![codecov](https://codecov.io/gh/swansonk14/typed-argument-parser/branch/main/graph/badge.svg)](https://codecov.io/gh/swansonk14/typed-argument-parser)
11+
[![license](https://img.shields.io/github/license/swansonk14/typed-argument-parser.svg)](https://github.com/swansonk14/typed-argument-parser/blob/main/LICENSE.txt)
1212

1313
Tap is a typed modernization of Python's [argparse](https://docs.python.org/3/library/argparse.html) library.
1414

@@ -17,7 +17,7 @@ Tap provides the following benefits:
1717
- Code completion
1818
- Source code navigation (e.g. go to definition and go to implementation)
1919

20-
![Tap](https://github.com/swansonk14/typed-argument-parser/raw/master/images/tap.png)
20+
![Tap](https://github.com/swansonk14/typed-argument-parser/raw/main/images/tap.png)
2121

2222
See [this poster](https://docs.google.com/presentation/d/1AirN6gpiq4P1L8K003EsXmobVxP3A4AVEIR2KOEQN7Y/edit?usp=sharing), which we presented at [PyCon 2020](https://us.pycon.org/2020/), for a presentation of some of the relevant concepts we used to guide the development of Tap.
2323

tests/test_utils.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
_nested_replace_type,
1919
define_python_object_encoder,
2020
UnpicklableObject,
21-
as_python_object
21+
as_python_object,
22+
enforce_reproducibility,
2223
)
2324

2425

@@ -454,5 +455,32 @@ def __init__(self):
454455
self.assertEqual(recreated_obj, expected_obj)
455456

456457

458+
class EnforceReproducibilityTests(TestCase):
459+
460+
def test_saved_reproducibility_data_is_none(self):
461+
with self.assertRaises(ValueError):
462+
enforce_reproducibility(None, {}, 'here')
463+
464+
def test_git_url_not_in_saved_reproducibility_data(self):
465+
with self.assertRaises(ValueError):
466+
enforce_reproducibility({}, {}, 'here')
467+
468+
def test_git_url_not_in_current_reproducibility_data(self):
469+
with self.assertRaises(ValueError):
470+
enforce_reproducibility({'git_url': 'none'}, {}, 'here')
471+
472+
def test_git_urls_disagree(self):
473+
with self.assertRaises(ValueError):
474+
enforce_reproducibility({'git_url': 'none'}, {'git_url': 'some'}, 'here')
475+
476+
def test_throw_error_for_saved_uncommitted_changes(self):
477+
with self.assertRaises(ValueError):
478+
enforce_reproducibility({'git_url': 'none', 'git_has_uncommitted_changes': True}, {'git_url': 'some'}, 'here')
479+
480+
def test_throw_error_for_uncommitted_changes(self):
481+
with self.assertRaises(ValueError):
482+
enforce_reproducibility({'git_url': 'none', 'git_has_uncommitted_changes': False}, {'git_url': 'some', 'git_has_uncommitted_changes': True}, 'here')
483+
484+
457485
if __name__ == '__main__':
458486
unittest.main()

0 commit comments

Comments
 (0)