Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

Added test for PDF011 #17

Merged
merged 2 commits into from
Apr 10, 2021
Merged

Conversation

leetaiying
Copy link
Contributor

@leetaiying leetaiying commented Apr 10, 2021

Closing issue #13.

@codecov
Copy link

codecov bot commented Apr 10, 2021

Codecov Report

Merging #17 (e508517) into main (ef8b5ca) will increase coverage by 0.88%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   84.70%   85.58%   +0.88%     
==========================================
  Files          26       26              
  Lines         340      340              
==========================================
+ Hits          288      291       +3     
+ Misses         52       49       -3     
Impacted Files Coverage Δ
pandas_dev_flaker/_plugins_tree/namespace_usage.py 100.00% <0.00%> (+12.50%) ⬆️
pandas_dev_flaker/_plugins_tree/conftest.py 100.00% <0.00%> (+16.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef8b5ca...e508517. Read the comment docs.

Comment on lines 38 to 48
(
pytest.param(
"from pandas import Categorical\n"
"import pandas as pd\n"
"\n"
"cat1 = Categorical()\n"
"cat2 = pd.Categorical()\n",
"5:7: PDF011 found both 'pd.foo' and 'foo' in the same file",
id="One is accessed from pd, the other is imported from pandas",
),
),
Copy link
Member

@MarcoGorelli MarcoGorelli Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Can we add an extra test in which we have

import pandas
from pandas import Categorical

cat1 = Categorical()
cat2 = pandas.Categorical()

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it doesn't pass, that's OK, let me know and I'll open a new issue for it and we can merge this one as it is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just added it.

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you @leetaiying !

@MarcoGorelli MarcoGorelli merged commit 5623fa0 into pandas-dev:main Apr 10, 2021
@leetaiying
Copy link
Contributor Author

Thank you @MarcoGorelli!!

@leetaiying leetaiying deleted the test-pdf011 branch April 10, 2021 17:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants