Skip to content
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

Remove print calls in tests #6718

Open
rdimaio opened this issue Apr 23, 2024 · 0 comments
Open

Remove print calls in tests #6718

rdimaio opened this issue Apr 23, 2024 · 0 comments
Labels

Comments

@rdimaio
Copy link
Contributor

rdimaio commented Apr 23, 2024

Doing a quick search for print( in tests/ returns more than 700 instances of printing in tests, e.g. as seen here:

if replica['name'] == self.tmp_file7.name:
print("Updating replica state as unavailable: " + replica['rses'][self.rse4recovery_id][0])
update_replica_state(self.rse4recovery_id, self.scope_declarebad, self.tmp_file7.name, ReplicaState.UNAVAILABLE)
if replica['name'] == self.tmp_file9.name:
print("Updating replica state as unavailable: " + replica['rses'][self.rse4recovery_id][0])
update_replica_state(self.rse4recovery_id, self.scope_declarebad, self.tmp_file9.name, ReplicaState.UNAVAILABLE)
if replica['name'] == self.tmp_file11.name:
print("Updating replica state as unavailable: " + replica['rses'][self.rse4recovery_id][0])
update_replica_state(self.rse4recovery_id, self.scope_declarebad, self.tmp_file11.name, ReplicaState.UNAVAILABLE)
if replica['name'] == self.tmp_file13.name:
print("Updating replica state as unavailable: " + replica['rses'][self.rse4recovery_id][0])
update_replica_state(self.rse4recovery_id, self.scope_declarebad, self.tmp_file13.name, ReplicaState.UNAVAILABLE)

Printing is useful for debugging, but once a test has been written and has the proper assertions, print statements should likely be removed.

print affects performance, as tested here: https://stackoverflow.com/questions/13288185/performance-effect-of-using-print-statements-in-python-script - we might be able to gain some performance in test speed by removing these calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant