-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Pcc04 #850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pcc04 #850
Conversation
|
@bbelderbos Something off with the tests here and I cant quite wrap my head around it. I needed to update pretty much everything in the requirements file due to version issues with python 3.10. not sure if this is something to do with the the patch for the mock? It could be that I totally have it wrong as well, let me know |
thanks, let me try it out tomorrow ... |
|
@rhyspowell did you copy the config-template.py to config.py? With some minor tweaks I get it working: The tests use mock data so I did not need to set real Twitter API tokens and stuff. |
|
yep all of that is running, the app even runs, just getting the error on the tests. I am using python 3.10.2 if that makes any difference @bbelderbos |
|
@rhyspowell hm I am on 3.10.0, what about Tweepy, I pip installed |
|
I thought this was mocked out? Maybe you can place a breakpoint right before this line to inspect the object? |
|
I'm on 4.10.1 of tweepy, lets see what happens if I update. drop the break right before that line in the test. Any idea what I should be looking for? |
|
ok, so here is the output from pytest FAILED test_usertweets.py::TestUserTweets::test_first_tweet_returned_by_api - AttributeError: 'tuple' object has no attribute 'user_timeline'
FAILED test_usertweets.py::TestUserTweets::test_num_tweets - AttributeError: 'tuple' object has no attribute 'user_timeline'
FAILED test_usertweets.py::TestUserTweets::test_read_back_from_cached_csv - AttributeError: 'tuple' object has no attribute 'user_timeline'We are now way outside of my comfort zone 😂 |
|
--- bbelderbos --- Nothing even like user_timeline |
|
Also from my REPL: |
|
ok, time i moved to pdb and not my usual print... Its going to be a learning experience |
|
@rhyspowell bit odd, maybe good to debug together at some points, because we've done the obvious checks. I am merging your submission now though so you get your Hacktoberfest credit. |
|
@bbelderbos let me know when and over what tool and we can do that. Its already been good for me, I've learned how to map the venv in vscode and I've used PDB properly for the first time 😂 |
I will ping you on Slack ... |
|
|
||
| ### How do I join your Slack Community? | ||
| Use [this link](https://join.slack.com/t/pybites/shared_invite/enQtNDAxODc0MjEyODM2LTNiZjljNTI2NGJiNWI0MTRkNjY4YzQ1ZWU4MmQzNWQyN2Q4ZTQzMTk0NzkyZTRmMThlNmQzYTk5Y2Y5ZDM4NDU) - and use our #codechallenges channel for coding questions. | ||
| Use [this link](https://pybit.es/community/) - and use our #codechallenges channel for coding questions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
| class TestUserTweets(unittest.TestCase): | ||
| def setUp(self): | ||
| super().setUp() | ||
| with patch('tweepy.API') as mock_timeline: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cause of issue + our oversight, fixed on master (template) branch: 7221ee2 - thanks.





ATTENTION: before clicking "Create Pull Request" please submit some meta data, thanks!
Difficulty level (1-10): [5]
Estimated time spent (hours): [3]
Completed (yes/no): [yes(Ish)]
I stretched my coding skills (if yes what did you learn?): []
Other feedback (what can we improve?): []