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

test: add full coverage #731

Merged
merged 2 commits into from
Oct 9, 2023
Merged

test: add full coverage #731

merged 2 commits into from
Oct 9, 2023

Conversation

ajberdy
Copy link
Contributor

@ajberdy ajberdy commented Oct 9, 2023

Issue #, if available:

Description of changes:

add unit tests to cover missed lines of code

Testing done:

unit tests

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ajberdy ajberdy requested a review from a team as a code owner October 9, 2023 20:35
@ajberdy
Copy link
Contributor Author

ajberdy commented Oct 9, 2023

bytestring sometimes wrapped in ", sometimes in '

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (a7e799c) 99.96% compared to head (41229b2) 100.00%.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/job-decorator      #731      +/-   ##
==========================================================
+ Coverage                  99.96%   100.00%   +0.03%     
==========================================================
  Files                        129       129              
  Lines                       8336      8335       -1     
  Branches                    1857      1857              
==========================================================
+ Hits                        8333      8335       +2     
+ Misses                         2         0       -2     
+ Partials                       1         0       -1     
Files Coverage Δ
src/braket/jobs/hybrid_job.py 100.00% <ø> (+2.97%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -158,6 +162,41 @@ def my_entry(a, b: int, c=0, d: float = 1.0, **extras) -> str:
mock_stdout.write.assert_any_call(s3_not_linked)


@patch("time.time", return_value=123.0)
@patch("builtins.open")
@patch("tempfile.TemporaryDirectory")
Copy link
Contributor

Choose a reason for hiding this comment

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

For clarity later on, it may be worthwhile to include why these patches are needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps, though I don't necessarily see this case as more opaque than a lot of our testing. Here we mock time to have a predictable job name, open to avoid actually creating any files, and tempdir to assert the correct temp dir gets created and removed

@ajberdy ajberdy requested a review from AbeCoull October 9, 2023 21:59
@ajberdy ajberdy merged commit c9fd192 into feature/job-decorator Oct 9, 2023
28 checks passed
@ajberdy ajberdy deleted the add-cov branch October 9, 2023 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants