Skip to content

Commit

Permalink
Add pytype disables for legacy unittests checking for incorrect types…
Browse files Browse the repository at this point in the history
… being passed to the API.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#1176 from google:dependabot/pip/pip-9d732ab251 f1af8f8
PiperOrigin-RevId: 691469173
  • Loading branch information
glados-verma authored and copybara-github committed Oct 30, 2024
1 parent 07e17f4 commit 66a8400
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,15 @@ virtualenv venv
# Activate the new virtualenv.
. venv/bin/activate

# Update setuptools.
pip install setuptools --upgrade
# Update build (run setuptools).
pip install build --upgrade

# Install openhtf into the virtualenv in dev mode.
python setup.py develop
pip install --editable .

# Install tox and run unit tests.
pip install tox
tox
```

### MacOS
Expand Down Expand Up @@ -268,7 +272,7 @@ virtualenv venv
. venv/bin/activate

# Install openhtf into the virtualenv in dev mode.
python setup.py develop
pip install --editable .
```

If you're having issues with the python setup, it's possible that the problem is due to El Capitan not including ssl headers. This [link](http://adarsh.io/bundler-failing-on-el-capitan/) may help you in that regard.
Expand Down Expand Up @@ -318,12 +322,8 @@ npm start
```

Now you've got the frontend building, but you still need to serve it. The
frontend server is started as a runnable module. In a terminal where your Python
virtual environment (set up above) is active, start the server with:

```bash
python -m openhtf.output.web_gui
```
frontend server is started as a runnable module. See the associated
[readme](openhtf/output/web_gui/README.md).

If you want the server to automatically restart when changes are detected, use
the `--dev` flag.
Expand Down
8 changes: 4 additions & 4 deletions test/core/measurements_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def test_bad_transform_fn(self):
"""Bad functions or setting multiple functions should raise."""
m = htf.Measurement('transform')
with self.assertRaises(TypeError):
m.with_transform(None)
m.with_transform(None) # pytype: disable=wrong-arg-types
with self.assertRaises(TypeError):
m.with_transform('int')
m.with_transform('int') # pytype: disable=wrong-arg-types
with self.assertRaises(ValueError):
m.with_transform(abs).with_transform(int)

Expand All @@ -94,9 +94,9 @@ def test_bad_precision(self):
"""Creating a measurement with invalid precision should raise."""
m = htf.Measurement('bad_precision')
with self.assertRaises(TypeError):
m.with_precision(1.1)
m.with_precision(1.1) # pytype: disable=wrong-arg-types
with self.assertRaises(TypeError):
m.with_precision('1')
m.with_precision('1') # pytype: disable=wrong-arg-types

def test_precision(self):
"""Check that with_precision does what it says on the tin."""
Expand Down

0 comments on commit 66a8400

Please sign in to comment.