Skip to content

Commit 02abbcf

Browse files
authored
Merge pull request #160 from n8downs/n8downs/fix-type-error-in-project-manager-report
Fix a type error in ProjectManager's report() function.
2 parents 1788fae + 7464b61 commit 02abbcf

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ It is part of the `Brightway LCA framework <https://brightway.dev>`_.
1414
`Online documentation <https://docs.brightway.dev/>`_ is available, and the source code is hosted on `GitHub brightway-lca organization <https://github.com/brightway-lca/brightway2-data>`_.
1515

1616
Note that version 4.0 and higher are only compatible with Brightway 2.5, as described in the `changelog <https://github.com/brightway-lca/brightway2-data/blob/main/CHANGES.md>`__.
17+
18+
19+
## Development Setup
20+
21+
```bash
22+
brightway2-data $ python3 -m venv venv
23+
brightway2-data $ source ./venv/bin/activate
24+
brightway2-data $ python3 -m pip install -r requirements-test.txt
25+
brightway2-data $ pytest
26+
```

bw2data/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def get_dir_size(dirpath):
363363
364364
Does not follow symbolic links"""
365365
return sum(
366-
sum(os.path.getsize(root / name) for name in files)
366+
sum(os.path.getsize(Path(root) / name) for name in files)
367367
for root, dirs, files in os.walk(dirpath)
368368
)
369369

tests/projects.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ def test_funny_project_names():
130130

131131
@bw2test
132132
def test_report():
133-
assert projects.report
133+
projects.set_current("foo")
134+
report = projects.report()
135+
assert "foo" in [name for (name, _, _) in report]
134136

135137

136138
@bw2test

0 commit comments

Comments
 (0)