Skip to content

Commit

Permalink
[ISSUE 173] correction of unit tests :(
Browse files Browse the repository at this point in the history
  • Loading branch information
dedece35 committed Apr 14, 2023
1 parent 4489cbf commit 4d99545
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function test() {
throw new SpecificException('Oopsie');
}

try // NOK {{Avoid using try-catch-finally}}
try // NOK {{Avoid using try-catch}}
{
$picture = PDF_open_image_file($PDF, "jpeg", $imgFile, "", 0); // This is the original statement, this works on PHP4
}
Expand All @@ -17,7 +17,7 @@ function test() {
throw new Exception($msg);
}

try { // NOK {{Avoid using try-catch-finally}}
try { // NOK {{Avoid using try-catch}}
throw new \Exception("Hello");
} catch(\Exception $e) {
echo $e->getMessage()." catch in\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
def my_function():
x=0

try: # Noncompliant {{Avoid the use of try-catch-finally}}
try: # Noncompliant {{Avoid the use of try-catch}}
print(x)
except:
print("Something went wrong")
finally:
print("The 'try except' is finished")

def foo():
try: # Noncompliant {{Avoid the use of try-catch-finally}}
try: # Noncompliant {{Avoid the use of try-catch}}
f = open(path)
print(f.read())
except:
Expand Down

0 comments on commit 4d99545

Please sign in to comment.