Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenseman committed Jul 23, 2020
1 parent e1c21f6 commit c1c8a6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/dbt/contracts/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def to_dict(self, omit_none=True, validate=False, *, with_aliases=False):

class UserConfigContract(Protocol):
send_anonymous_usage_stats: bool
use_colors: bool
use_colors: Optional[bool]
partial_parse: Optional[bool]
printer_width: Optional[int]

Expand Down
6 changes: 1 addition & 5 deletions core/dbt/contracts/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,7 @@ def set_values(self, cookie_dir):
tracking.do_not_track()

if self.use_colors is not None:
if self.use_colors:
ui.use_colors()
else:
ui.do_not_use_colors()

ui.use_colors(self.use_colors)

if self.printer_width:
ui.printer_width(self.printer_width)
Expand Down
5 changes: 4 additions & 1 deletion core/dbt/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def set_from_args(args):
# The use_colors attribute will always have a value because it is assigned
# None by default from the add_mutually_exclusive_group function
use_colors_override = getattr(args, 'use_colors')
USE_COLORS = use_colors_override if use_colors_override is not None else USE_COLORS

if use_colors_override is not None:
USE_COLORS = use_colors_override


# initialize everything to the defaults on module load
reset()
8 changes: 2 additions & 6 deletions core/dbt/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@
PRINTER_WIDTH = 80


def use_colors():
flags.USE_COLORS = True


def do_not_use_colors():
flags.USE_COLORS = False
def use_colors(use_colors_val=True):
flags.USE_COLORS = use_colors_val


def printer_width(printer_width):
Expand Down

0 comments on commit c1c8a6a

Please sign in to comment.