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

refactor: JUnit Jupiter best practices #30

Merged
merged 2 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/test/java/org/openrewrite/python/tree/BlockTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def f():

@ParameterizedTest
@ValueSource(strings = {"", "\n", "\n\n", "\n\n\n"})
public void deeplyNested(String eof) {
void deeplyNested(String eof) {
rewriteRun(python(
"""
def f1():
Expand All @@ -118,7 +118,7 @@ def f4():

@ParameterizedTest
@ValueSource(strings = {"", "\n", "\n\n", "\n\n\n"})
public void lineEndingLocations(String eof) {
void lineEndingLocations(String eof) {
rewriteRun(
python(
"""
Expand All @@ -140,7 +140,7 @@ public void lineEndingLocations(String eof) {
"def f(x): x = x + 1; return x;",
"def f(x): x = x + 1; return x ;",
})
public void oneLineBlocks(String code) {
void oneLineBlocks(String code) {
rewriteRun(
python(code)
);
Expand Down Expand Up @@ -209,7 +209,7 @@ with stuff() as x:
pass
""",
})
public void nested(String block) {
void nested(String block) {
rewriteRun(
python(
"""
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openrewrite/python/tree/LambdaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import static org.openrewrite.python.Assertions.python;

public class LambdaTest implements RewriteTest {
class LambdaTest implements RewriteTest {

@Test
void group() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openrewrite/python/tree/SwitchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import static org.openrewrite.python.Assertions.python;

public class SwitchTest implements RewriteTest {
class SwitchTest implements RewriteTest {

@Test
void simple() {
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/org/openrewrite/python/tree/TernaryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

import static org.openrewrite.python.Assertions.python;

public class TernaryTest implements RewriteTest {
class TernaryTest implements RewriteTest {

@ParameterizedTest
@ValueSource(strings = {
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
"x = 3 if True else 1",
})
public void test(String expr) {
void test(String expr) {
rewriteRun(python(expr));
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openrewrite/python/tree/ThrowsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import static org.openrewrite.python.Assertions.python;

public class ThrowsTest implements RewriteTest {
class ThrowsTest implements RewriteTest {

@Test
void raise() {
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/org/openrewrite/python/tree/TryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import static org.openrewrite.python.Assertions.python;

public class TryTest implements RewriteTest {
class TryTest implements RewriteTest {

@ParameterizedTest
@CsvSource(textBlock = """
Expand All @@ -43,7 +43,7 @@ public class TryTest implements RewriteTest {
"" , "*TypeError"
"" , " *TypeError"
""", quoteCharacter = '"')
public void testTryExcept(String afterTry, String afterExcept) {
void testTryExcept(String afterTry, String afterExcept) {
rewriteRun(python(
"""
try%s:
Expand All @@ -60,7 +60,7 @@ public void testTryExcept(String afterTry, String afterExcept) {
" TypeError " , " OSError"
" TypeError" , " OSError "
""", quoteCharacter = '"')
public void testTryMultiExcept(String afterFirstExcept, String afterSecondExcept) {
void testTryMultiExcept(String afterFirstExcept, String afterSecondExcept) {
rewriteRun(python(
"""
try:
Expand All @@ -75,7 +75,7 @@ public void testTryMultiExcept(String afterFirstExcept, String afterSecondExcept

@ParameterizedTest
@ValueSource(strings = {"", " "})
public void testTryFinally(String afterFinally) {
void testTryFinally(String afterFinally) {
rewriteRun(python(
"""
try:
Expand All @@ -88,7 +88,7 @@ public void testTryFinally(String afterFinally) {

@ParameterizedTest
@ValueSource(strings = {"", " "})
public void testTryExceptFinally(String afterFinally) {
void testTryExceptFinally(String afterFinally) {
rewriteRun(python(
"""
try:
Expand All @@ -103,7 +103,7 @@ public void testTryExceptFinally(String afterFinally) {

@ParameterizedTest
@ValueSource(strings = {"", " "})
public void testElse(String afterElse) {
void testElse(String afterElse) {
rewriteRun(python(
"""
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import static org.openrewrite.python.Assertions.python;

public class TypeCommentTest implements RewriteTest {
class TypeCommentTest implements RewriteTest {

@ParameterizedTest
@ValueSource(strings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import static org.openrewrite.python.Assertions.python;

public class VariableScopeTest implements RewriteTest {
class VariableScopeTest implements RewriteTest {
@ParameterizedTest
@ValueSource(strings = {"nonlocal", "global"})
public void singleName(String kind) {
void singleName(String kind) {
rewriteRun(
python(
"""
Expand All @@ -37,7 +37,7 @@ def foo():

@ParameterizedTest
@ValueSource(strings = {"nonlocal", "global"})
public void multipleNames(String kind) {
void multipleNames(String kind) {
rewriteRun(
python(
"""
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/openrewrite/python/tree/WithTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import static org.openrewrite.python.Assertions.python;

public class WithTest implements RewriteTest {
class WithTest implements RewriteTest {

@ParameterizedTest
@ValueSource(strings={
@ValueSource(strings = {
"A()",
"A() as a",
"A() as a",
Expand All @@ -39,7 +39,7 @@ public class WithTest implements RewriteTest {
"A() as a, B() as b",
"A() as a, B() as b ",
})
public void simple(String vars) {
void simple(String vars) {
rewriteRun(python(
"""
with %s:
Expand Down