Skip to content

Make file paths in tests agnostic to execution source path #2701 #2727

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

Conversation

eldbud
Copy link
Contributor

@eldbud eldbud commented Oct 11, 2021

  • added PROJECT_ROOT_PATH and TEST_DATA_PATH constants in conftest
  • added data_file function in conftest
  • converted usages of files from the data folder to use the data_file function

resolves #2701

Bibo-Joshi and others added 27 commits September 15, 2021 17:09
…ryptionError (python-telegram-bot#2621)

* move telegramdecryptionerror to error.py

* Change error class name
…t#2612)

* feat: add docs about docs

* fix: improve looks

* fix: make link work

* fix: this looks better

* Improved markdown, updated link

* Less justifying

Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Fix incomplete type annotations for CallbackContext

Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
* Feat: Custom pytest marker

Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Make basepersistence methods abstractmethod

Signed-off-by: starry69 <starry369126@outlook.com>

Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
…m-bot#2634)

Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: poolitzer <25934244+Poolitzer@users.noreply.github.com>
# Conflicts:
#	telegram/bot.py
#	telegram/ext/callbackcontext.py
#	telegram/ext/dispatcher.py
#	telegram/ext/extbot.py
#	telegram/ext/jobqueue.py
#	tests/conftest.py
#	tests/test_bot.py
…unction to conftest, replaced usages of paths with the above wherever possible
…n_source_path_#2701

# Conflicts:
#	tests/test_bot.py
#	tests/test_files.py
#	tests/test_warnings.py
@eldbud eldbud changed the title Make file paths in tests agnostic to execution source path #2701 Make file paths in tests agnostic to execution source path resolves #2701 Oct 11, 2021
@eldbud eldbud changed the title Make file paths in tests agnostic to execution source path resolves #2701 Make file paths in tests agnostic to execution source path #2701 Oct 11, 2021
@eldbud
Copy link
Contributor Author

eldbud commented Oct 11, 2021

tried all the ways the instructions provide to link this pr to the issue - commit with keyword and issue number in message, and also in the description. doesn't link...

Copy link
Member

@eldbud Not your fault, it only works when the base branch is master apparently, we'll manually link and close it

@harshil21 harshil21 added the ⚙️ tests affected functionality: tests label Oct 12, 2021
@harshil21 harshil21 added this to the v14 milestone Oct 12, 2021
@Bibo-Joshi
Copy link
Member

Overall looks good - nice contribution! I take it that you actually tested running the tests from different working directories?
Can you please merge v14 into this branch? IISC there are some commits are not in your branch yet and e.g. #2724 added new files to the tests

@eldbud
Copy link
Contributor Author

eldbud commented Oct 12, 2021

I take it that you actually tested running the tests from different working directories?

indeed :)

@eldbud
Copy link
Contributor Author

eldbud commented Oct 12, 2021

I take it that you actually tested running the tests from different working directories?

indeed :)

i just rechecked my reply, and i see i do have a problem with test_webhook_ssl_just_for_telegram, when not running from project root. I'll attend to it later today.

@eldbud
Copy link
Contributor Author

eldbud commented Oct 12, 2021

i just rechecked my reply, and i see i do have a problem with test_webhook_ssl_just_for_telegram, when not running from project root. I'll attend to it later today.

ok, fixed. pr is ready for merge unless there are any issues i need to attend to.

@Bibo-Joshi seems i have no authorization to request review ("reviewers" on the right side pane is empty, and clicking it does nothing)

@Bibo-Joshi Bibo-Joshi merged commit 1adc96c into python-telegram-bot:v14 Oct 13, 2021
@Bibo-Joshi
Copy link
Member

Thanks for the nice contribution :)

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2021
@harshil21 harshil21 added the hacktoberfest-accepted other: hacktoberfest-accepted label Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hacktoberfest-accepted other: hacktoberfest-accepted ⚙️ tests affected functionality: tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE/DISCUSSION] Make file paths in tests agnostic to execution source path
7 participants