Comments (5)
Eventually, the test with https://docs.python.org/3/library/unittest.mock.html#mock-open I did not finish it, it seems the function can digest any kinds of arguments.
The test with temp file in b141b15 is really preferred one: it is quicker to write and easier to maintain, and allows to test for (3) functionality too.
@pytest.fixture
def temp_path():
with NamedTemporaryFile() as f:
abspath = f.name
p = Path(abspath)
p.write_text("abc\n123")
return p
class Test_open_csv:
def test_on_string_argument_raises_TypeError(self):
path_string = 'abc.csv'
with pytest.raises(TypeError):
open_csv(path_string)
def test_on_Path_runs_with_no_error(self, temp_path):
assert open_csv(temp_path)
def test_on_Path_provides_readable_input(self, temp_path):
with open_csv(temp_path) as f:
assert f.readlines() == ['abc\n', '123']
from parser-rosstat-kep.
@bakakaldsas, I need you final "yes, sure" kind of approval to close this 👍
from parser-rosstat-kep.
Yes, this is definitelly better.
from parser-rosstat-kep.
So for the sake of cleaner test file the multiple test cases should be removed only leaving the preferred version?
from parser-rosstat-kep.
from parser-rosstat-kep.
Related Issues (20)
- add Vintage.upload() method HOT 1
- processed/latest folder needs better handling
- certain variables not found in Vinatage.validate() HOT 2
- review check procedure HOT 7
- Missing values should not be False at dataframe construction HOT 5
- shorter decimal representation in CSV file HOT 2
- replace Table class with Table2
- add coverable badge
- adapt code to create html with headers and charts HOT 8
- code review for `dev-sceleton` branch
- speed up manage.parse() HOT 3
- create parsing definition for 'profit' variable
- start of minimal example in julia HOT 1
- start of minimal example in go
- clean notebooks folder and dev_scrap branch
- duplicate code: get_year() vs clean year()
- why smaller code has longer running time?
- trace where duplicate values are created
- how to control warnings issue?
- industial goods production
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parser-rosstat-kep.